I wish to uncover a curve (a potential energy v distance) bit-by-bit while explaining what is going on.
The code below is only ok, the problem is that the curve changes shape from slide 3 to slide 4. I can live with it and am not losing too much sleep over it ;) but I would like to find the obviously simple solution.
I realise it is to do with the way I am plotting the curve. I plot the curve on each slide as a separate curve with just extra coordinate points. (full curve coordinates given in each and commented out the "extra points").
Ideally, I should be uncovering just sections of the curve.
These solutions Uncover line segments of a TikZ graph in Beamer and Uncover segments of a TikZ path in Beamer work with straight lines not curves...
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{patterns}
\begin{document}
\begin{frame}{Real Gases}
\begin{tikzpicture}
\onslide<6->{\draw[green!20, pattern color =green!20, thin,pattern=north west lines] (0,-5) rectangle (2,2) node[rotate=90,midway,above] {\tiny{\textcolor{green!30!black}{repulsive forces dominant}}};}% drawn first so appear as underlay
\onslide<6->{\draw[red!0, pattern color =red!20, thin,pattern=north west lines] (2,-5) rectangle (10,2) node[midway,above] {\tiny{\textcolor{red!30!black}{attractive forces dominant}}};}
\onslide<1->{\draw[thick,->] (0,0) --(10,0) node[above left=0.2] {\tiny{Separation}};}
\onslide<1->{\draw[thick,->] (0,-5) --(0,2) node[rotate=90, near end,above] {\tiny{Potential Energy}};}
\onslide<2>{\draw[color=blue, thick,-] plot[smooth] coordinates{%(1.35,2)(1.4,1.75)(1.5,1.5) (2,0) (3,-3) (4,-5)(5,-4.5)(6,-2)(7,-0.8)
(8,-0.3)(9,-0.1) (10,0)};}
\onslide<3>{\draw[color=blue, thick,-] plot[smooth] coordinates{%(1.35,2)(1.4,1.75)(1.5,1.5)(2,0)(3,-3)
(4,-5)(5,-4.5)(6,-2)(7,-0.8)(8,-0.3)(9,-0.1) (10,0)};}
\onslide<4>{\draw[color=blue, thick,-] plot[smooth] coordinates{%(1.35,2)(1.4,1.75)(1.5,1.5)
(2,0) (3,-3) (4,-5)(5,-4.5)(6,-2)(7,-0.8)(8,-0.3)(9,-0.1) (10,0)};}
\onslide<5->{\draw[color=blue, thick,-] plot[smooth] coordinates{(1.35,2)(1.4,1.75)(1.5,1.5)(2,0) (3,-3) (4,-5)(5,-4.5)(6,-2)(7,-0.8)(8,-0.3)(9,-0.1) (10,0)};}
\end{tikzpicture}
\end{frame}
\end{document}