1

I'm trying to follow the $6^{th}$ tutorial of the pgf manual. I managed to create the mindmap, but I cannot correctly fade colors from one to another:

enter image description here

this is the code that generated the image (I've included the mindmap and shadows libraries):

\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}

This is identical to the code that is presented on the manual (I've also tried to copy and paste the code on the manual without any success).

Has anyone have any idea for why I cannot reproduce the behavior displayed in the manual (i.e. "fading" between different concept colors)?

Thanks in advance

1 Answer 1

2

You pass the options to the node, not to the child. If you correct this, you get

\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}

enter image description here

It is planned to make this distinction more explicit in future versions of the pgfmanual.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .