0
$\begingroup$

In attempting to answer this question about animating a rolling disk, I constructed a ParametricPlot to Animate. The plot looks fine when not animated, yet while the animation runs the slider moves but there is no plot until the animation stops; after a short delay, the final state of the plot shows up.

How do I ensure the animation shows the elements of the plot?

 mypara[α_] := ParametricPlot[
   {
    {Cos[θ], Sin[θ]},
    {2 Cos[α] + Cos[θ], 
     2 Sin[α] + Sin[θ]}
   },
   {θ, 0, 2 π},
   {r, 1, 2},
   PlotRange -> 3,
   Frame -> False
   ]
 Animate[
   mypara[α],
   {α, 0, 2 π, π/6},
   AnimationRepetitions -> 1
   ]

enter image description here

$\endgroup$
  • 2
    $\begingroup$ Use Block[{$PerformanceGoal}, mypara[\[Alpha]]] p.s. there is y0 definition missing. $\endgroup$ – Kuba Apr 29 '15 at 8:11
  • $\begingroup$ Thanks @kuba - this solves the immediate problem: the plot is visible. Unfortunately, it doesn't run smoothly but instead jumps to discrete points in the animation. $\endgroup$ – TransferOrbit Apr 30 '15 at 9:55
1
$\begingroup$

Another way is just to render the frames first and then use ListAnimate, (BTW I set y0 to -0.1, since its definition is missing)

mypara[\[Alpha]_] := 
  ParametricPlot[{{Cos[\[Theta]], Sin[\[Theta]]}, 
  {2 Cos[\[Alpha]] + Cos[\[Theta]], 2 Sin[\[Alpha]] + Sin[\[Theta]]},
  {r, 0}}, 
  {\[Theta], 0, 2 \[Pi]}, {r, 1, 2}, PlotRange -> 3, Frame -> False]

 list1 = Table[mypara[\[Alpha]], {\[Alpha], 0, 2 \[Pi], \[Pi]/6}]
 ListAnimate[list1, AnimationRepetitions -> 1]
$\endgroup$
  • $\begingroup$ Thank you @lalmei ; this did work once. Unfortunately, the statement Table[myparaL[α], {α, 0, 2 π, π/16}] now crashes my kernel every time if I try it with a higher number of snapshots in the Table, even after restarting Mathematica. $\endgroup$ – TransferOrbit Apr 30 '15 at 11:11
  • $\begingroup$ @zentient Most likely is due to the fact you are using Pi instead of its numerical value, change the integers to real values 2 ->2.0 16->16.0 etc. $\endgroup$ – lalmei Apr 30 '15 at 11:52
  • $\begingroup$ Thanks again. Using real values does help slightly. Unfortunately, generating the Table of ParametricPlots crashes regularly when generating only a slightly larger number of plots in the Table. $\endgroup$ – TransferOrbit May 1 '15 at 8:54

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.