Hans Petter Langtangen 10 anni fa
parent
commit
fdfa65f9b3

+ 8 - 0
doc/pub/tutorial/._pysketcher003.html

@@ -901,6 +901,14 @@ at each time level. The resulting sketches are saved to files
         <span style="color: #008000; font-weight: bold">print</span>(cmd)
         os<span style="color: #666666">.</span>system(cmd)
 </pre></div>
+<p>
+This time we did not use the <code>animate</code> function from Pysketcher, but
+stored each sketch in a file with <code>drawing_tool.savefig</code>. Note that
+the argument <code>crop=False</code> is key: otherwise each figure is cropped and
+it makes to sense to combine the images to a video. By default,
+Pysketcher crops (removes all exterior whitespace) from figures saved
+to file.
+
 <p>
 
 <div>

+ 7 - 0
doc/pub/tutorial/html/_sources/main_sketcher.txt

@@ -1358,6 +1358,13 @@ at each time level. The resulting sketches are saved to files
                 print(cmd)
                 os.system(cmd)
 
+This time we did not use the ``animate`` function from Pysketcher, but
+stored each sketch in a file with ``drawing_tool.savefig``. Note that
+the argument ``crop=False`` is key: otherwise each figure is cropped and
+it makes to sense to combine the images to a video. By default,
+Pysketcher crops (removes all exterior whitespace) from figures saved
+to file.
+
 .. raw:: html
         
         <div>

+ 6 - 0
doc/pub/tutorial/html/main_sketcher.html

@@ -1136,6 +1136,12 @@ at each time level. The resulting sketches are saved to files
         <span class="n">os</span><span class="o">.</span><span class="n">system</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
 </pre></div>
 </div>
+<p>This time we did not use the <code class="docutils literal"><span class="pre">animate</span></code> function from Pysketcher, but
+stored each sketch in a file with <code class="docutils literal"><span class="pre">drawing_tool.savefig</span></code>. Note that
+the argument <code class="docutils literal"><span class="pre">crop=False</span></code> is key: otherwise each figure is cropped and
+it makes to sense to combine the images to a video. By default,
+Pysketcher crops (removes all exterior whitespace) from figures saved
+to file.</p>
 <div>
 <video  loop controls width='640' height='365' preload='none'>
     <source src='https://github.com/hplgit/pysketcher/raw/master/doc/pub/tutorial/mov-tut/pendulum/movie.mp4'  type='video/mp4;  codecs="avc1.42E01E, mp4a.40.2"'>

File diff suppressed because it is too large
+ 1 - 1
doc/pub/tutorial/html/searchindex.js


BIN
doc/pub/tutorial/pysketcher.pdf


+ 2 - 1
pysketcher/shapes.py

@@ -136,7 +136,8 @@ def animate(fig, time_points, action, moviefiles=False,
         drawing_tool.display(title=title, show=show_screen_graphics)
 
         if moviefiles:
-            drawing_tool.savefig('%s%04d.png' % (framefilestem, n))
+            drawing_tool.savefig('%s%04d.png' % (framefilestem, n),
+                                 crop=False)
 
     if moviefiles:
         return '%s%%04d.png' % framefilestem