Friday 15 April 2011

Python animation using matplotlib -


I am browsing SO queries for Docs, Examples, and Hours and I'm still unable to locate it

A set of values ​​(or independent values)

  • A
  • A color (such as '# 00FF00' )
  • An alpha ( Like .5 )

    It is such that I can create individual image plots in this way:

      N = 100 # How do I tell that this number Or how important it is. For the frame (N) for the border: In the range I have in category (template) in the template, yPlots, colorplate, alpha plot = getPlotData (frame): plt.figure () plt.plot (tPlots [i], yPlots [ I], color = color plot [i], alpha = alpha plots [i]) plt.show ()  

    but it definitely produces static data, one per frame. I want to make films from these frames, but for the API matplotlib is very confusing for the animation / movies, there are many options to choose and no one looks simple, in any way naturally My actions are organized to create frames. I have revised the getPlotData (index) several times, to try to use it in some way with the matplotlib method, although currently 3-refractor form Most usable (most modular).

    The simplest way seemed to be that I can only create a list frame, but I still use getPlotData (index) above In the case of the following from

    Any thoughts? Thank you.

    EDIT: I just wanted to be clear, I intend to save the movie in MP3 or any other file format. I do not intend to run Python script later, only movie file If you really want to save things in a movie, then you << p>

  • Code> Matplotlib , does not matter how it performs computational:

    1. Set your figure: fig = Pipelot.figure (fig = (W, H) DPI = 100) or so;
    2. Make your drawing
    3. Fig. ("{Framenumber: 06d} .png" .format (framenumber = counter))
    4. Rinse, repeat

    and then use the example To convert maincoder to a movie:

      maincoder -o output.mp4-osm mpeg4 * .png  

    No comments:

    Post a Comment