我正在尝试按照第 6 个教程进行操作pgf 手册。我设法创建了思维导图,但我无法正确地将一种颜色淡化为另一种颜色:
这是生成图像的代码(我已包含mindmap
和shadows
库):
\begin{tikzpicture} [mindmap]
\begin{scope}[
every node/.style={concept, execute at begin node=\hskip0pt, circular drop shadow},
root concept/.append style={concept color=black, fill=white, line width=1ex, text=black, font=\large\scshape},
text=white,
computational problems/.style={concept color=red, faded/.style={concept color=red!50}},
computational models/.style={concept color=blue, faded/.style={concept color=blue!50}},
measuring complexity/.style={concept color=orange, faded/.style={concept color=orange!50}},
solving problems/.style={concept color=green!50!black, faded/.style={concept color=green!50!black!50}},
grow cyclic,
level 1/.append style={sibling angle=90, level distance=4.5cm, font=\scshape},
level 2/.append style={sibling angle=45, level distance=3cm, font=\footnotesize},
]
\node[root concept] {Computational Complexity}
child[computational problems] { node {Computational Problems}
child { node {Problem Measures} }
child { node {Problem Aspects} }
child { node[concept color=blue] {Problem Domains} }
child { node {Key Problems} }
}
child[computational models] { node {Computational Models}
child { node {Turing Machines} }
child { node[faded] {Random-Access Machines} }
child { node {Circuits} }
child { node[faded] {Binary Decision Diagrams} }
child { node {Oracle Machines} }
child { node {Programming in Logic} }
}
child[measuring complexity] { node {Measuring Complexity}
child { node {Complexity Measures} }
child { node {Classifying Complexity} }
child { node {Comparing Complexity} }
child { node[faded] {Describing Complexity} }
}
child[solving problems] { node {Solving Problems}
child { node {Exact Algorithms} }
child { node {Randomization} }
child { node {Fixed-Parameter Algorithms} }
child { node {Parallel Computation } }
child { node {Partial Solutions} }
child { node {Approximation} }
};
\end{scope}
\end{tikzpicture}
这与手册中提供的代码相同(我也尝试复制并粘贴手册中的代码,但没有成功)。
有谁知道为什么我无法重现手册中显示的行为(即不同概念颜色之间的“褪色”)?
提前致谢
答案1
您将选项传递给节点,而不是子节点。如果您更正此问题,您将得到
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{mindmap,shadows}
\begin{document}
\begin{tikzpicture} [mindmap]
\begin{scope}[
every node/.style={concept, execute at begin node=\hskip0pt, circular drop shadow},
root concept/.append style={concept color=black, fill=white, line width=1ex, text=black, font=\large\scshape},
text=white,
computational problems/.style={concept color=red,
faded/.style={concept color=red!50}},
computational models/.style={concept color=blue,
faded/.style={concept color=blue!50}},
measuring complexity/.style={concept color=orange, faded/.style={concept color=orange!50}},
solving problems/.style={concept color=green!50!black, faded/.style={concept color=green!50!black!50}},
grow cyclic,
level 1/.append style={sibling angle=90, level distance=4.5cm, font=\scshape},
level 2/.append style={sibling angle=45, level distance=3cm, font=\footnotesize},
]
\node[root concept] {Computational Complexity}
child[computational problems] { node {Computational Problems}
child { node {Problem Measures} }
child { node {Problem Aspects} }
child[concept color=blue] { node {Problem Domains} }
child { node {Key Problems} }
}
child[computational models] { node {Computational Models}
child { node {Turing Machines} }
child[faded] { node {Random-Access Machines} }
child { node {Circuits} }
child[faded] { node {Binary Decision Diagrams} }
child { node {Oracle Machines} }
child { node {Programming in Logic} }
}
child[measuring complexity] { node {Measuring Complexity}
child { node {Complexity Measures} }
child { node {Classifying Complexity} }
child { node {Comparing Complexity} }
child[faded] { node {Describing Complexity} }
}
child[solving problems] { node {Solving Problems}
child { node {Exact Algorithms} }
child { node {Randomization} }
child { node {Fixed-Parameter Algorithms} }
child { node {Parallel Computation } }
child { node {Partial Solutions} }
child { node {Approximation} }
};
\end{scope}
\end{tikzpicture}
\end{document}
计划使这一区别更加明确在 pgfmanual 的未来版本中。