所谓思维导图,就是概念以及相关概念、标注的图形化表示。有一个被称为根概念,它被表示为一个 巨大的圆或椭圆。相关概念呈须状在其分支上。在tikz中绘制思维导图,要用到“mindmap”库, 所以请在LaTeX导言中加入
\usetikzlibrary{mindmap}
为了绘制思维导图,请在图形选项或范围选项中使用风格
mindmap比如
\tikz[mindmap,concept color=red!50] \node [concept] {Root concept} child[grow=right] {node[concept] {Child concept}};如果有什么特别的设置,可以使用风格
every mindmap表示概念的圆或椭圆的大小可以用风格
small mindmap
large mindmap
huge mindmap
在tikz中一个概念其实就是一个节点,只不过在节点选项中加入了
concept所有的概念节点受
every concept影响。概念的颜色可以用
concept color=颜色表达式设置。
那些孤立的概念可以用选项
extra concept比如
\begin{tikzpicture}[mindmap,concept color=blue!80]相应的风格是
\node [concept] {Root concept};
\node [extra concept] at (10,0) {extra concept};
\end{tikzpicture}
every extra concept
关联的概念被组织成一棵树,有一个所谓根概念
root concept接着是围绕根概念的一层一层的相关概念
level 1 concept比如
level 2 concept
level 3 concept
level 4 concept
\tikz
[root concept/.append style={concept color=blue!80},
level 1 concept/.append style={concept color=red!50}, mindmap]
\node [concept] {Root concept}
child[grow=30] {node[concept] {child}}
child[grow=0 ] {node[concept] {child}};
概念间的简单的连接可以设置风格
concept connection比如
\begin{tikzpicture}
[root concept/.append style={concept color=blue!20,minimum size=2cm},
level 1 concept/.append style={sibling angle=45},mindmap]
\node [concept] {Root concept}
[clockwise from=45]
child { node[concept] (c1) {child}}
child { node[concept] (c2) {child}}
child { node[concept] (c3) {child}};
\begin{pgfonlayer}{background}
\draw [concept connection] (c1) edge (c2) edge (c3) (c2) edge (c3);
\end{pgfonlayer}
\end{tikzpicture}
我们可以用一个装饰
circle connection bar来连接概念,它有下列属性
start radius比如
end radius
amplitude
angle
\begin{tikzpicture}你还可以用选项
[decoration={start radius=1cm,end radius=.5cm,amplitude=2mm,angle=30}]
\fill[blue!20] (0,0) circle (1cm);
\fill[red!20] (2.5,0) circle (.5cm);
\filldraw [draw=red,fill=black,
decorate,decoration=circle connection bar] (1,0) -- (2,0);
\end{tikzpicture}
/tikz/circle connection bar switch color=from (颜色1)to (颜色2)指定沿着连接颜色的变化。比如
\begin{tikzpicture}[outer sep=0pt]
\node (n1) at (0,0) [circle,minimum size=2cm,fill,draw,thick,red] {};
\node (n2) at (30:2.5) [circle,minimum size=1cm,fill,draw,thick,blue] {};
\path (n1) to[circle connection bar switch color=from (red) to (blue)] (n2);
\end{tikzpicture}
你可以通过在节点选项中加入
annotation使其成为一个标注。标注的风格是
every annotation比如
\begin{tikzpicture}
[mindmap,concept color=blue!80,
every annotation/.style={fill=red!20}]
\node [concept] (root) {Root concept};
\node [annotation,right] at (root.east)
{The root concept is, in general, the most important concept.};
\end{tikzpicture}