I have come to look on how to draw a student law with Tex and I have been very pleased with the first answer I found here
Nevertheless, I found that the animation displayed in the first answer is even better than what I wanted to do.
But I am incapable of creating it. I have looked around for informations about the animate package, but my tries are unsuccessful.
I thought something like
%\documentclass[handout]{beamer}
\documentclass{beamer}
\usetheme[secheader]{Boadilla}
\usecolortheme{seahorse}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref} % Pour les liens hypertexte
\usepackage{pgfplots} % Pour les graphes
\usepackage{animate} % Pour les animations
\def\basefunc{ % La densité de Student
gamma(.5*(\n+1))/(sqrt(\n*pi)*gamma(.5*\n))*((1+x^2/\n)^(-.5*(\n+1)))%
}
\begin{document}
\frame{
\begin{animateinline}{1}
\foreach \n in {1}{
\begin{tikzpicture}
\begin{axis}[ymin=0,ymax=.41, ]
\addplot gnuplot [
smooth,
no marks,
domain={-6:+6},
]{\basefunc};
\legend{$n = \n$}
\end{axis}
\end{tikzpicture}
}
\foreach \n in {2, 3, 4, 5}{
\newframe
\begin{tikzpicture}
\begin{axis}[ymin=0,ymax=.41, ]
\addplot gnuplot [
smooth,
no marks,
domain={-6:+6},
]{\basefunc};
\legend{$n = \n$}
\end{axis}
\end{tikzpicture}
}
\end{animateline}
}
\end{document}
would work but it does not (I get a * \begin{lrbox} on input line 127 ended by \end{animateline}.* error).
Can someone help me ?
animate
package (instead of producing a document with many pages)?