Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@parulnith
Created April 13, 2019 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parulnith/99289d99473993c7d311c1be4ecf30c6 to your computer and use it in GitHub Desktop.
Save parulnith/99289d99473993c7d311c1be4ecf30c6 to your computer and use it in GitHub Desktop.
import numpy as np
from matplotlib import pyplot as plt
from celluloid import Camera
fig, axes = plt.subplots(2)
camera = Camera(fig)
t = np.linspace(0, 2 * 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('celluloid_subplots.gif', writer = 'imagemagick')
@cluoxu2020
Copy link

nice, wonderful imaging voice sounds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment