-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
In the "Custom figures" section, we should add an example on how to make animations with Plopp, based on MPL's animation functionality.
The example would be something like
import plopp as pp
import matplotlib.animation as animation
# Some 3d data
da = pp.data.data3d()
data_node = pp.Node(da)
index_node = pp.Node(0)
# Here, 'z' is the dimension you want to slice
slice_node = pp.Node(lambda da, ind: da['z', ind], da=data_node, ind=index_node)
f = pp.imagefigure(slice_node, cbar=True)
def update(frame):
index_node.func = lambda: frame
index_node.notify_children('')
ani = animation.FuncAnimation(fig=f.fig, func=update, frames=30, interval=30)
ani.save(filename="html_example.html", writer="html")but would be nice with some more interesting data (maybe the three_bands data from the plopp.data.examples?).
Metadata
Metadata
Assignees
Labels
No labels