Message Boards Message Boards

0
|
3720 Views
|
9 Replies
|
4 Total Likes
View groups...
Share
Share this post:

How can I export an animated image

Posted 3 years ago

I have this:

Clear [r];
r[t_] := 5 + Sin[10 t];
curves = ParametricPlot[r[t] {Cos[t], Sin[t]}, {t, 0, 2 Pi}];
Animate[Show[curves, 
  Graphics[{PointSize[0.03], Point[r[t] {Cos[t], Sin[t]}]}]], {t, 0, 
  2 Pi}]

How can I export the resulting animated image? Thank you.

POSTED BY: Georges Sardin
9 Replies

The animation in the gif picture the point turns automatically in both sides. Is there an option to be added to make it turn only in one direction.

Clear[r];
r[t_] := 5 + Sin[10 t];
curves = ParametricPlot[r[t] {Cos[t], Sin[t]}, {t, 0, 2 Pi}];

anim = Animate[
  Show[curves, 
   Graphics[{PointSize[0.03], Point[r[t] {Cos[t], Sin[t]}]}]], {t, 0, 
   2 Pi}]
Export["anim2.gif", anim, AnimationRepetitions -> Infinity]
POSTED BY: Georges Sardin

However, the gif image goes differently than in the animation cell. It goes automatically in one way and in the reverse, and the commands are not activated. Can this be fixed?

POSTED BY: Georges Sardin

Thank you.

POSTED BY: Georges Sardin

You can export Animate directly. If you want to keep controls:

Clear[r];
r[t_]:=5+Sin[10 t];
curves=ParametricPlot[r[t] {Cos[t],Sin[t]},{t,0,2 Pi}];

anim=Animate[Show[curves,
Graphics[{PointSize[0.03],Point[r[t] {Cos[t],Sin[t]}]}]],{t,0,2 Pi}];

Export["anim.gif",anim,AnimationRepetitions->Infinity]

enter image description here

POSTED BY: Vitaliy Kaurov

Thanks again.

POSTED BY: Georges Sardin
Posted 3 years ago

Hi Georges,

For endless looping use the "AnimationRepetitions" option

Export["animation.gif", frames, "AnimationRepetitions" -> Infinity]

I don't know of a way to include the Animate controls in the export.

I am 80 years old and I started learning Mathematica

That is awesome! If you have not, I suggest reading Stephen Wolfram's An Elementary Introduction to the Wolfram Language. It is available free online.

POSTED BY: Rohit Namjoshi

Rohit,

If you don't mind could you tell me what to do for the point not to stop running on the gif picture. And also if it is possible to get the command bar also on the gif picture. I am 80 years old and I started learning mathematica.

POSTED BY: Georges Sardin

Rohit, Thanks a lot.

POSTED BY: Georges Sardin
Posted 3 years ago

Georges,

One way

frames = Table[
   Show[curves, 
    Graphics[{PointSize[0.03], Point[r[t] {Cos[t], Sin[t]}]}]], {t, 0,2 Pi, Pi/36}];

Export["animation.gif", frames]
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract