Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge fix of standard example animation into APNG branch.
Browse files Browse the repository at this point in the history
Since the APNG code I'm about to commit rejects frames of different sizes,
the doctest for show will fail unless the example gets fixed.
  • Loading branch information
gagern committed Jul 16, 2014
2 parents bb7307f + 04665b0 commit bc9f681
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/sage/plot/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ class Animation(SageObject):
EXAMPLES::
sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.3)],
....: xmin=0, xmax=2*pi, figsize=[2,1])
sage: a = animate([plot(sin(x + float(k)), (x,0,2*pi))
....: for k in srange(0,2*pi,0.3)],
....: ymin=-1, ymax=1, figsize=[2,1])
sage: a
Animation with 21 frames
sage: a[:5]
Expand Down Expand Up @@ -195,8 +196,9 @@ def __init__(self, v=None, **kwds):
EXAMPLES::
sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.3)],
....: xmin=0, xmax=2*pi, figsize=[2,1]) # indirect doctest
sage: a = animate([plot(sin(x + float(k)), (x,0,2*pi))
....: for k in srange(0,2*pi,0.3)],
....: ymin=-1, ymax=1, figsize=[2,1])
sage: a
Animation with 21 frames
"""
Expand Down Expand Up @@ -517,8 +519,9 @@ def gif(self, delay=20, savefile=None, iterations=0, show_path=False,
EXAMPLES::
sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.7)],
....: xmin=0, xmax=2*pi, figsize=[2,1])
sage: a = animate([plot(sin(x + float(k)), (x,0,2*pi))
....: for k in srange(0,2*pi,0.7)],
....: ymin=-1, ymax=1, figsize=[2,1])
sage: dir = tmp_dir()
sage: a.gif() # not tested
sage: a.gif(savefile=dir + 'my_animation.gif', delay=35, iterations=3) # optional -- ImageMagick
Expand Down Expand Up @@ -608,9 +611,10 @@ def show(self, delay=20, iterations=0):
EXAMPLES::
sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.7)],
....: xmin=0, xmax=2*pi, figsize=[2,1])
sage: a.show() # optional -- ImageMagick
sage: a = animate([plot(sin(x + float(k)), (x,0,2*pi))
....: for k in srange(0,2*pi,0.7)],
....: ymin=-1, ymax=1, figsize=[2,1])
sage: a.show() # optional -- ImageMagick
The preceding will loop the animation forever. If you want to show
only three iterations instead::
Expand Down Expand Up @@ -706,8 +710,9 @@ def ffmpeg(self, savefile=None, show_path=False, output_format=None,
EXAMPLES::
sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.7)],
....: xmin=0, xmax=2*pi, figsize=[2,1])
sage: a = animate([plot(sin(x + float(k)), (x,0,2*pi))
....: for k in srange(0,2*pi,0.7)],
....: ymin=-1, ymax=1, figsize=[2,1])
sage: dir = tmp_dir()
sage: a.ffmpeg(savefile=dir + 'new.mpg') # optional -- ffmpeg
sage: a.ffmpeg(savefile=dir + 'new.avi') # optional -- ffmpeg
Expand Down Expand Up @@ -829,8 +834,9 @@ def save(self, filename=None, show_path=False, use_ffmpeg=False):
EXAMPLES::
sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.7)],
....: xmin=0, xmax=2*pi, figsize=[2,1])
sage: a = animate([plot(sin(x + float(k)), (x,0,2*pi))
....: for k in srange(0,2*pi,0.7)],
....: ymin=-1, ymax=1, figsize=[2,1])
sage: dir = tmp_dir()
sage: a.save() # not tested
sage: a.save(dir + 'wave.gif') # optional -- ImageMagick
Expand Down

0 comments on commit bc9f681

Please sign in to comment.