0
\documentclass[tikz,border=10pt]{standalone}  
\usepackage{pgfplots}  
\usepackage{forest}  
\usetikzlibrary{shadows}  
\begin{document}  
\begin{forest}
  shade me/.style={%  
    bottom color=#1!25,  
    top color=#1!5,  
    draw=#1,  
    drop shadow,  
    font=\Huge,  
  },  
  my label/.style n args=2{%  
    edge label={node [midway, black, font=\sffamily\large, #1] {#2}}  
  },  
  where n children=0{%  
    shade me=green!95!gray,
  }{%  
    if level=0{%  
      shade me=green!95!gray,  
    }{%  
      shade me=green!95!gray, 
    }  
  },  
  for tree={%  
    delay={content/.wrap value={\strut #1}},  
    edge={red,->},  
    l sep+=45pt,  
    s sep+=60pt  
  }  
  [100000 individuals  
  [100 affected, my label={above, xshift=1cm}{}  
      [{95\% true positives}, my label={below, xshift=-1.7cm}{}  
    [,phantom] [{95 + 999 test positive, Total = 1094}, my label={above, sloped}{}, name=aux1]]]  
    [99900 unaffected, my label={above, sloped}{}  
      [{1\% false positives}, my label={below, xshift=1.5cm}{}, name=aux  
 % [{95 + 999 test positive Total = 1094}, my label={above, sloped}{}]
 ]]        ]  
    ]  
  ]  
  \draw[red, ->] (aux)--(aux1);
\end{forest}  
\end{document} 
4

Note that I had to modify your MWE in various ways in order to make it question-ready before starting work on a solution.

  1. When a question is inherently about a particular class, a suitable MWE needs to use that class. The first obviously required change in this case is to use beamer. There's no point in trying to implement incremental uncovering otherwise. (Perhaps you could play with the beamer option of standalone, but your MWE didn't use that.)

  2. The second obviously needed modification is that before you can even think about fancy overlay specifications, you need to revise the tree specification as it is quite unsuitable for a Beamer slide as is. It is simply huge.

  3. A good deal of the code for the tree is entirely unused and can simply be removed from the example. No edge labels are just as good for this purpose - perhaps better - than empty ones.

That done, here's a solution based on the method I use which is heavily indebted to the various authors, especially Qrrbrbirlbel, noted in the code.

\begin{filecontents}{mytree.tex}
\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{forest}
\usetikzlibrary{shadows}
\begin{document}
\begin{forest}
    shade me/.style={%
      bottom color=#1!25,
      top color=#1!5,
      draw=#1,
    },
    where n children=0{%
      shade me=green!95!gray,
    }{%
      if level=0{%
        shade me=green!95!gray,
      }{%
        shade me=green!95!gray,
      }
    },
    for tree={%
      delay={content/.wrap value={\strut #1}},
      edge={red,->},
      l sep+=20pt,
      s sep+=20pt,
      from slide/.wrap pgfmath arg={#1}{int(level()+1)},
    },
    delay={%
      for tree={%
        visible on=<\forestoption{from slide}->,
        alt=<\forestoption{from slide}->{drop shadow}{},
      }
    }
    [100000 individuals
      [100 affected
        [{95\% true positives}
          [,phantom
          ]
          [{95 + 999 test positive, Total = 1094}, name=aux1
          ]
        ]
      ]
      [99900 unaffected
        [{1\% false positives}, tikz+={\scoped[visible on=<4>]{\draw [red, ->] () -- (aux1);}}
        ]
      ]
    ]
  \end{forest}
\end{document}
\end{filecontents}
\documentclass{beamer}
\usepackage{forest,standalone}
\usetikzlibrary{shadows}
\tikzset{% set up for transitions using tikz with beamer overlays - developed by Daniel (http://tex.stackexchange.com/a/55849/) and, in ear lier form, by Matthew Leingang (http://tex.stackexchange.com/a/6155/) and modified for this use, I think by Qrrbrbirlbel (http://tex.stacke xchange.com/a/112471/)
  invisible/.style={opacity=0,text opacity=0},
  visible on/.style={alt=#1{}{invisible}},
  alt/.code args={<#1>#2#3}{%
    \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
  },
}
\forestset{%
  visible on/.style={% developed by Qrrbrbirlbel (http://tex.stackexchange.com/a/112471/)
    for tree={%
      /tikz/visible on={#1},
      edge={/tikz/visible on={#1}}}},
  % based on Qrrbrbirlbel's answer at http://tex.stackexchange.com/a/112895/
  declare toks={from slide}{1},
}
\begin{document}
\begin{frame}
  \centering
  \input{mytree}
\end{frame}
\end{document}

incremental uncovering level by level

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.