[SciPy-User] Package recommendations for *efficiently* making good looking animations, or alternatively, how can I "predraw" matplotlib animation frames?
Paul Kilgo
paulkilgo at gmail.com
Sun Mar 8 19:38:13 EDT 2015
I can't comment much about matplotlib, but you might take a look at Vispy
when exploring your options. It seems more geared toward interactive
visualization which I think is what you're going for. It's pretty young and
the documentation is mostly for reference, but they have a nice gallery of
examples. I found it fairly easy to get up and going just from that.
That said, I only used their "lower-level" gloo API which I would say
requires a fair amount of knowledge of OpenGL and GLSL. It looks like they
are working on a higher-level API (they call it "visuals"). I didn't touch
this at all.
I bet there is someone subscribed to this list who knows a lot more than me
about it. :)
On Sun, Mar 8, 2015 at 5:40 PM Brian Merchant <bhmerchant at gmail.com> wrote:
> Hi all,
>
> Right now, I am at the simulation stage in my modelling. I need to explore
> possible behaviours, in some parameter sets. In order to do this
> exploration, it is helpful to visualize the data via animation.
>
> I started with matplotlib, but am disappointed with how long it takes to
> produce an animation using my data. It is also difficult for me to navigate
> matplotlib's documentation. Anyway, let me explain what I am doing right
> now.
>
> Currently, my custom matplotlib animation (i.e. a class that inherit's
> from
>
> animation.TimedAnimation) class's `_draw_frame` method does this:
>
> 1. get line data for timestep `n`
> 2. update data of each line of interest in the axes with `set_data` (lets
> say for the sake of an example (`ax_line1.set_data(datax, datay`, where
> `ax_line1, = ax.plot(...)`)
> 3. make a list of each line that was updated, and set
> `self._drawn_artists` to that (so in the example if two lines of interest
> are there, then we update them `self._drawn_artists = [ax_line1, ax_line2]`
>
> Is there a way I can set the data in multiple copies of the line artists
> before `_draw_frame` is called? Then, all that `_draw_frame` has to do is
> fetch the predrawn lines, and update the drawn artist list with that.
>
> That means that I set the artist data in parallel, if I have the data
> already, and thus produce an animation faster? I tried doing
> `copy.deepcopy` of the artists, but got an error telling me that I cannot
> do so (`TransformationNode` has to be frozen). What other options do I have?
>
> At this point, I am totally open to exploring other packages apart from
> matplotlib, that may be recommended.
>
> Kind regards,
> Brian
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150308/27a1ae1b/attachment.html>
More information about the SciPy-User
mailing list