Open JohnTigue opened 4 years ago
MPL can do animations, but how well?
# https://stackoverflow.com/a/43447370
import matplotlib.pyplot as plt
import matplotlib.animation
import numpy as np
t = np.linspace(0,2*np.pi)
x = np.sin(t)
fig, ax = plt.subplots()
ax.axis([0,2*np.pi,-1,1])
l, = ax.plot([],[])
def animate(i):
l.set_data(t[:i], x[:i])
a
ani = matplotlib.animation.FuncAnimation(fig, animate, frames=len(t))
from IPython.display import HTML
#HTML(ani.to_jshtml())
HTML(ani.to_html5_video())
In 2019 there was one quick attempt to render a HTML5 movie, which did work but was of low quality. Tuning was not attempted.
A web movie should be web friendly, not too big. And a movie is not the tool for deeply exploring the data, it's a quick overview. So, for second attempt, downsample images first then movize.