Following this question of mine, I now need to make a presentation using Beamer.
If you look at the plot below, it has some values on the arrows namely p1, 1-p1, ... I want to put the graph structure first and then when pressing the arrow key get the values showing one by one.
Just writing \pause in front of the nodes doesn't work, that would have been too simple. I don't know how to make it happen, anyone help?
\documentclass{beamer}
\usepackage{tikz}
\usepackage{amssymb}
\usetikzlibrary{arrows,positioning}
\usepackage[english]{babel}
\usepackage{amsmath}
\begin{document}
\begin{frame}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.5cm,
thick,main node/.style={rectangle,draw,font=\sffamily\Large \bfseries}]
\node[main node] (1) {1};
\node[main node] (2) [below = of 1] {2};
\node[main node] (3) [below = of 2] {3};
\node[main node,draw = none] (4) [right = 2in of 1] {$\varnothing$};
\node[main node,draw = none] (5) [right = 2in of 2] {$\varnothing$};
\node[main node,draw = none] (6) [right = 2in of 3] {$\varnothing$};
\path[every node/.style={font=\sffamily\small}]
(1) edge node [left] {$p_1$} (2)
edge node [above] {$1-p_1$} (4)
(2) edge node [left] {$p_2$} (3)
edge node [above] {$1-p_2$} (5)
(3) edge node [above] {$1-p_3$} (6);
\path[draw,every node/.style={font=\sffamily\small}]
(3.west) -- ([xshift=-2cm]3.west) -- ([xshift=-2cm]1.west) node [midway,left] {$p_3$} -- (1.west);
\end{tikzpicture}
\end{frame}
\end{document}


visible on=<2->and set the value to be 5 and above for it to work. Does this represent the nth click? And how can I know apart from trial and error method? – user88595 Jun 09 '14 at 14:36<2->means it will be shown from second in advance,<2>only on second frame,<2-4>on second, third and foorth frame, ... If you previously plan how the labels are shown you know the frame number. In any case I've included some other answer which can help you. – Ignasi Jun 09 '14 at 14:43aobs-tikzpackage for the purpose of combining TikZ and beamer overlay – Herr K. Jun 09 '14 at 17:47