# pip install celluloid #%matplotlib qt from matplotlib import pyplot as plt from celluloid import Camera import numpy as np fig, axes = plt.subplots(2) camera = Camera(fig) t = np.linspace(0, 2.0*np.pi, 128, endpoint=False) for i in t: axes[0].plot(t, np.sin(t + i), color='blue') axes[1].plot(t, np.sin(t - i), color='blue') camera.snap() animation = camera.animate() animation.save('ex354.gif', writer='PillowWriter', fps=24)
Recent Comments