|
1 |
| -# sage.doctest: optional - sage.symbolic |
| 1 | +# sage.doctest: needs sage.symbolic |
2 | 2 | r"""
|
3 | 3 | Animated plots
|
4 | 4 |
|
@@ -526,27 +526,28 @@ def graphics_array(self, ncols=3):
|
526 | 526 |
|
527 | 527 | EXAMPLES::
|
528 | 528 |
|
529 |
| - sage: E = EllipticCurve('37a') # optional - sage.schemes |
530 |
| - sage: v = [E.change_ring(GF(p)).plot(pointsize=30) # optional - sage.rings.finite_rings sage.schemes |
| 529 | + sage: # needs sage.schemes |
| 530 | + sage: E = EllipticCurve('37a') |
| 531 | + sage: v = [E.change_ring(GF(p)).plot(pointsize=30) |
531 | 532 | ....: for p in [97, 101, 103]]
|
532 |
| - sage: a = animate(v, xmin=0, ymin=0, axes=False) # optional - sage.rings.finite_rings sage.schemes |
533 |
| - sage: print(a) # optional - sage.rings.finite_rings sage.schemes |
| 533 | + sage: a = animate(v, xmin=0, ymin=0, axes=False) |
| 534 | + sage: print(a) |
534 | 535 | Animation with 3 frames
|
535 |
| - sage: a.show() # optional -- ImageMagick # optional - sage.rings.finite_rings sage.schemes |
| 536 | + sage: a.show() # optional - imagemagick |
536 | 537 |
|
537 | 538 | Modify the default arrangement of array::
|
538 | 539 |
|
539 |
| - sage: g = a.graphics_array(); print(g) # optional - sage.rings.finite_rings sage.schemes |
| 540 | + sage: g = a.graphics_array(); print(g) # needs sage.schemes |
540 | 541 | Graphics Array of size 1 x 3
|
541 |
| - sage: g.show(figsize=[6,3]) # optional - sage.rings.finite_rings sage.schemes |
| 542 | + sage: g.show(figsize=[6,3]) # needs sage.schemes |
542 | 543 |
|
543 | 544 | Specify different arrangement of array and save it with a given file name::
|
544 | 545 |
|
545 |
| - sage: g = a.graphics_array(ncols=2); print(g) # optional - sage.rings.finite_rings sage.schemes |
| 546 | + sage: g = a.graphics_array(ncols=2); print(g) # needs sage.schemes |
546 | 547 | Graphics Array of size 2 x 2
|
547 |
| - sage: f = tmp_filename(ext='.png'); print(f) # optional - sage.rings.finite_rings sage.schemes |
| 548 | + sage: f = tmp_filename(ext='.png'); print(f) # needs sage.schemes |
548 | 549 | ...png
|
549 |
| - sage: g.save(f) # optional - sage.rings.finite_rings sage.schemes |
| 550 | + sage: g.save(f) # needs sage.schemes |
550 | 551 |
|
551 | 552 | Frames can be specified as a generator too; it is internally converted to a list::
|
552 | 553 |
|
@@ -852,18 +853,20 @@ def show(self, delay=None, iterations=None, **kwds):
|
852 | 853 |
|
853 | 854 | You can also make use of the HTML5 video element in the Sage Notebook::
|
854 | 855 |
|
855 |
| - sage: a.show(format="ogg") # long time # optional -- ffmpeg |
856 |
| - sage: a.show(format="webm") # long time # optional -- ffmpeg |
857 |
| - sage: a.show(format="mp4") # long time # optional -- ffmpeg |
858 |
| - sage: a.show(format="webm", iterations=1) # long time # optional -- ffmpeg |
| 856 | + sage: # long time, optional - ffmpeg |
| 857 | + sage: a.show(format="ogg") |
| 858 | + sage: a.show(format="webm") |
| 859 | + sage: a.show(format="mp4") |
| 860 | + sage: a.show(format="webm", iterations=1) |
859 | 861 |
|
860 | 862 | Other backends may support other file formats as well::
|
861 | 863 |
|
862 |
| - sage: a.show(format="flash") # long time # optional -- ffmpeg |
863 |
| - sage: a.show(format="matroska") # long time # optional -- ffmpeg |
864 |
| - sage: a.show(format="avi") # long time # optional -- ffmpeg |
865 |
| - sage: a.show(format="wmv") # long time # optional -- ffmpeg |
866 |
| - sage: a.show(format="quicktime") # long time # optional -- ffmpeg |
| 864 | + sage: # long time, optional - ffmpeg |
| 865 | + sage: a.show(format="flash") |
| 866 | + sage: a.show(format="matroska") |
| 867 | + sage: a.show(format="avi") |
| 868 | + sage: a.show(format="wmv") |
| 869 | + sage: a.show(format="quicktime") |
867 | 870 |
|
868 | 871 | TESTS:
|
869 | 872 |
|
@@ -1163,22 +1166,23 @@ def save(self, filename=None, show_path=False, use_ffmpeg=False, **kwds):
|
1163 | 1166 | Ensure that we can pass delay and iteration count to the saved
|
1164 | 1167 | GIF image (see :trac:`18176`)::
|
1165 | 1168 |
|
1166 |
| - sage: a.save(td + 'wave.gif') # long time # optional -- ImageMagick |
1167 |
| - sage: with open(td + 'wave.gif', 'rb') as f: # long time # optional -- ImageMagick |
| 1169 | + sage: # long time, optional - imagemagick |
| 1170 | + sage: a.save(td + 'wave.gif') |
| 1171 | + sage: with open(td + 'wave.gif', 'rb') as f: |
1168 | 1172 | ....: print(b'GIF8' in f.read())
|
1169 | 1173 | True
|
1170 |
| - sage: with open(td + 'wave.gif', 'rb') as f: # long time # optional -- ImageMagick |
| 1174 | + sage: with open(td + 'wave.gif', 'rb') as f: |
1171 | 1175 | ....: print(b'!\xff\x0bNETSCAPE2.0\x03\x01\x00\x00\x00' in f.read())
|
1172 | 1176 | True
|
1173 |
| - sage: a.save(td + 'wave.gif', delay=35) # long time # optional -- ImageMagick |
1174 |
| - sage: with open(td + 'wave.gif', 'rb') as f: # long time # optional -- ImageMagick |
| 1177 | + sage: a.save(td + 'wave.gif', delay=35) |
| 1178 | + sage: with open(td + 'wave.gif', 'rb') as f: |
1175 | 1179 | ....: print(b'GIF8' in f.read())
|
1176 | 1180 | True
|
1177 |
| - sage: a.save(td + 'wave.gif', iterations=3) # long time # optional -- ImageMagick |
1178 |
| - sage: with open(td + 'wave.gif', 'rb') as f: # long time # optional -- ImageMagick |
| 1181 | + sage: a.save(td + 'wave.gif', iterations=3) |
| 1182 | + sage: with open(td + 'wave.gif', 'rb') as f: |
1179 | 1183 | ....: print(b'!\xff\x0bNETSCAPE2.0\x03\x01\x00\x00\x00' in f.read())
|
1180 | 1184 | False
|
1181 |
| - sage: with open(td + 'wave.gif', 'rb') as f: # long time # optional -- ImageMagick |
| 1185 | + sage: with open(td + 'wave.gif', 'rb') as f: |
1182 | 1186 | ....: check1 = b'!\xff\x0bNETSCAPE2.0\x03\x01\x02\x00\x00'
|
1183 | 1187 | ....: check2 = b'!\xff\x0bNETSCAPE2.0\x03\x01\x03\x00\x00'
|
1184 | 1188 | ....: data = f.read()
|
|
0 commit comments