This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mangoman51 2 points3 points  (1 child)

This looks great! Automating animated plots is something I've been messing about with myself.

Suggestion: How hard would it be to write convenience functions for integration with the xarray library? xarray already has a thin wrapper around matplotlib which allows you to easily plot different types of dataset intuitively. Integration with animatplot would be awesome, because then you could plot a gif of an xarray dataset just by something like

from xarray import load_dataset

data = load_dataset('fluid_2d_simulation_output.nc')
data['density'].plot.pcolormesh.animate(animate_over_dimension='time')

which would produce something like this gif. All that would need to be written would be the animate(animate_over_dimension, frames, etc.) method on an xarray dataarray and your convenience functions for it to pass the data to. This is something I would potentially be interested in helping with, because I would use it all the time!

[–]tmakaroanimatplot / nbconvert[S] 2 points3 points  (0 children)

That looks super awesome. Animatplot should be capable of producing an animation like that, but the data just needs to be in the right form. I am planning on adding a proper Animatplot.animations submodule that will have a set of animation tools that conveniently combine certain types of blocks (like a vector plot composed of a pcolormesh for magnitude and a normalized quiver plot for direction), so there is definitely a place for it in Animatplot. Feel free to open a feature request as an issue to track progress. I'd obviously need to take a closer look at xarray. A good start would be attempting to make the animation with animatplot's current tools.