非樹狀結構點對點 tikz 心智圖

非樹狀結構點對點 tikz 心智圖

使用 tikz 建立心智圖的所有範例都使用樹狀方法:父節點位於中間,其具有較小的子節點,其具有較小的子節點,等等。

是否可以建立點對點心智圖,即不是樹狀結構,而是在祖先樹的同一層級上具有多個節點的結構。例如這樣的事情:

在此輸入影像描述

節點 A、B 和 C 的大小都相同且彼此完全連接?

答案1

這可以使用 Tik 實現Zmindmaps圖書館。但你必須手動繪製第一級節點之間的連接:

\documentclass[tikz]{standalone}
\usetikzlibrary{mindmap,backgrounds}

\begin{document}

\begin{tikzpicture}[mindmap,concept color=black]

  \node[concept,fill=blue!30] (A) at (0,0) {A}
   child[grow=200] {node[concept,fill=blue!20] (Aa) {a}}
   child[grow=240] {node[concept,fill=blue!20] (Ab) {b}};

  \node[concept,fill=red!30] (B) at (5,5) {B}
   child[grow=20] {node[concept,fill=red!20] (Ba) {a}}
   child[grow=160] {node[concept,fill=red!20] (Bb) {b}};

  \node[concept,fill=green!30] (C) at (10,0) {C}
   child[grow=340] {node[concept,fill=green!20] (Ca) {a}}
   child[grow=300] {node[concept,fill=green!20] (Cb) {b}};

  \path
   (A) to[circle connection bar] (B)
   (B) to[circle connection bar] (C) 
   (A) to[circle connection bar] (C);

\end{tikzpicture}

\end{document}

在此輸入影像描述

答案2

論壇上有很多解決方案,例如這裡,只需要進行少量修改。

\documentclass[tikz]{standalone}
\usetikzlibrary{mindmap}
\pagestyle{empty}
\begin{document}
\def\colorLeft{green!50!yellow!70!red!30!blue}
\def\colorRight{orange}
\def\colorTop{red!80!blue!80}
\begin{tikzpicture}[small mindmap, outer sep=0pt, text=black]
% from https://tex.stackexchange.com/a/144828/121799
\begin{scope}[concept color=\colorRight]
\node (right) at (-30:3) [concept] {Right}
  [clockwise from=0]
  child { node[concept] {R.1} }
  child { node[concept] {R.2} }
;
\end{scope}

\begin{scope}[concept color=\colorLeft]
\node (left) at (210:3) [concept] {Left}
  [counterclockwise from=180]
  child { node[concept] {L.1}  }
  child { node[concept] {L.2} }
;
\end{scope}

\begin{scope}[concept color=\colorTop]
\node (top) at (90:3) [concept] {Top}
  [counterclockwise from=53]
  child { node[concept] {T.1}  }
  child { node[concept] {T.2} }
;
\end{scope}


\path (left) to[circle connection bar switch color=from (\colorLeft) to (\colorRight)] (right) ;
\path (left) to[circle connection bar switch color=from (\colorLeft) to (\colorTop)] (top) ;
\path (top) to[circle connection bar switch color=from (\colorTop) to (\colorRight)] (right) ;


\end{tikzpicture}
\end{document}

在此輸入影像描述

相關內容