Last active
April 13, 2019 13:47
-
-
Save parulnith/8e55323704750049f875684b65b37cde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
from matplotlib import pyplot as plt | |
from celluloid import Camera | |
fig = plt.figure() | |
camera = Camera(fig) | |
for i in range(20): | |
t = plt.plot(range(i, i + 5)) | |
plt.legend(t, [f'line {i}']) | |
camera.snap() | |
animation = camera.animate() | |
animation.save('celluloid_legends.gif', writer = 'imagemagick') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment