Opened 8 years ago

Last modified 6 years ago

#13279 new enhancement

Improve documentation for `animate`

Reported by: benjaminfjones Owned by: jason, was
Priority: minor Milestone: sage-6.4
Component: graphics Keywords: documentation animate graphics
Cc: kcrisman, niles Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

The docstring for the top level animate function is spare. It should be improved with more examples that illustrate existing functionality.

For example, missing from the docstring are examples of superimposing (using +) and concatenating (using *) animate objects.

Here is an example of superimposing frames which comes from the ask.sagemath question http://ask.sagemath.org/question/1604/making-an-array-of-animations.

sin_frames = []
circ_frames = []
circ_x = -1.5 # offset center of the circle
circ_y = 0
for i in srange(0,2*pi,0.2):
    singraph = point((i,sin(i)), color="green", size=50)
    singraph += plot(sin(x),(0,2*pi), xmin=0, xmax=7, ymin=-1, ymax=1, figsize=[2,2], axes=False)
    unitcircle = point((cos(i)+circ_x,sin(i)+circ_y), color="green", size=50)
    unitcircle += circle((circ_x,circ_y),1, color="blue", figsize=[2,2], axes=False)
    sin_frames.append(singraph)
    circ_frames.append(unitcircle)

A1 = animate(sin_frames)
A2 = animate(circ_frames)
show(A1+A2) # superimpose frames

Change History (4)

comment:1 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:2 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:4 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.