How can I uncover the nodes in the following tikzpicture? I want to display all red nodes, followed by all green nodes, and then followed by all blue nodes.

\tikzstyle{level 1}=[sibling angle=120]
\tikzstyle{level 2}=[sibling angle=60]
\tikzstyle{level 3}=[sibling angle=30]
\tikzstyle{every node}=[fill,inner sep=0pt,minimum size=4pt]
\tikzstyle{edge from parent}=[segment length=1mm,
                          segment angle=10,draw] 
\begin{tikzpicture}[grow cyclic,shape=circle,very thick,level distance=13mm,
\node {} child [color=\A] foreach \A in {red,red,red}
{  node {} child [color=\A!50!\B] foreach \B in {green,green,green}
     { node {} child [color=\A!50!\B!50!\C] foreach \C in {blue,blue,blue}
         { node {} }
  • 1
    While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. May 20, 2012 at 7:22
  • 2
    Note that \tikzstyle is deprecated. See e.g. Should \tikzset or \tikzstyle be used to define TikZ styles? May 20, 2012 at 9:53
  • @PeterGrill: Thanks for the note. I would provide MWE for my questions.
    – Kabira K
    May 21, 2012 at 0:56

1 Answer 1


In this solution I applied the Daniel's method shown in Mindmap tikzpicture in beamer (reveal step by step): it has several advantages and it is very simple to be used.

In the following code, with respect to the MWE provided, I shifted in the preamble the style definitions:


% style definitions
\tikzset{level 1/.style={sibling angle=120}}
\tikzset{level 2/.style={sibling angle=60}}
\tikzset{level 3/.style={sibling angle=30}}
\tikzset{every node/.style={fill,inner sep=0pt,minimum size=4pt}}
\tikzset{edge from parent/.style={segment length=1mm,
                          segment angle=10,draw}}

% Daniel's code:
% https://tex.stackexchange.com/questions/55806/tikzpicture-in-beamer/55827#55827
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
      \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path

\begin{tikzpicture}[grow cyclic,shape=circle,very thick,level distance=13mm,
\node {} child [color=\A,visible on=<1->] foreach \A in {red,red,red}
{  node {} child [color=\A!50!\B,visible on=<2->] foreach \B in {green,green,green}
     { node {} child [color=\A!50!\B!50!\C,visible on=<3->] foreach \C in {blue,blue,blue}
         { node {} }


What you simply have to do, once inserted in the preamble the Daniel's code, is to define in which time instant you want to display nodes; the method is to add in child options visible on=<...>.

Finally, what you get are those three frames:

enter image description here

  • 1
    A really cool feature of this approach is that you can even use visible on=<\slide-> in a \foreach \slide in {...} loop. This is also not possible with the standard TikZ syntax.
    – cgogolin
    Mar 8, 2016 at 17:03

You must log in to answer this question.

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