I'm trying to create an animated Chi-Square Distribution from a static file with ps-tricks and animate, but the proportions are completely messed up in the animated figure. I guess there's some tiny rub in my code I'm too blind by now to find...

The static figure:
Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage{pst-func}
\usepackage{graphicx} %graphic support
\begin{document}
\psset{xunit=1cm,yunit=7.5cm,plotpoints=200}
\begin{pspicture*}(-0.9,-0.1)(12,.9)
\rput[t]{0}(4,0.5){$f(x;k) = \frac{1}{2^{k/2}\Gamma(k/2)}x^{k/2-1}e^{-x/2}$}
\multido{\rnue=0.5+0.5, \iblue=10+10, \rloc=0.6+-0.05}{10}{%
\psChiIIDist[linewidth=1pt, linecolor=blue!\iblue, nue=\rnue]{0.01}{11}
\psframe*[linecolor=white,framearc=0.1](8,0.1)(8,0.7)
\psline[linewidth=1pt, linecolor=blue!\iblue]{-}(8,\rloc)(8.5,\rloc)
\uput[0](8.7,\rloc){\scriptsize k = \rnue}}
\psaxes[Dy=0.1, tickstyle=bottom]{->}(0,0)(0,0)(12,.9)
\end{pspicture*}
\end{document}
Code: Select all
\documentclass[a4paper,12pt]{article}
\usepackage{pst-func}
\usepackage{graphicx}
\usepackage{animate}
\begin{document}
%-------------------- write timeline file ---------------------%
\newwrite\TimeLineFile
\immediate\openout\TimeLineFile=chi.txt
\immediate\write\TimeLineFile{::0x0}
\multido{\i=1+1}{10}{\immediate\write\TimeLineFile{::\i}}
\immediate\closeout\TimeLineFile
%------------------- assemble animation ------------------------%
\psset{xunit=1cm, yunit=7.5cm, plotpoints=200}
\begin{animateinline}[controls,
buttonsize=1em,
timeline=chi.txt,
begin={\begin{pspicture}(-0.9,-0.1)(12,.9)},
end={\end{pspicture}}]{6}
\psaxes[Dy=0.1, tickstyle=bottom]{->}(0,0)(0,0)(12,.9)
\newframe
\multiframe{10}{rnue=0.5+0.5, iblue=10+10, rloc=0.6+-0.05}{%
\psChiIIDist[linewidth=1pt, linecolor=blue!\iblue, nue=\rnue]{0.01}{11}
\psline[linewidth=1pt, linecolor=blue!\iblue]{-}(8,\rloc)(8.5,\rloc)
\psframe*[linecolor=white,framearc=0.1](8,0.1)(8,0.7)
\uput[0](8.7,\rloc){\scriptsize k = \rnue}}
\end{animateinline}
\end{document}
Alrik
P.S.: I use the output profile LaTeX=>PS=>PDF under Windows Vista with MikTex 2.7 and TeXnic Center 1 Beta 7.50.