About
The matplotlib Animation Extension
Install & Import
pip install gif
import gif
Quickstart
import gif
from random import randint
from matplotlib import pyplot as plt
x = [randint(0, 100) for _ in range(100)]
y = [randint(0, 100) for _ in range(100)]
gif.options.matplotlib["dpi"] = 300
@gif.frame
def plot(i):
xi = x[i*10:(i+1)*10]
yi = y[i*10:(i+1)*10]
plt.scatter(xi, yi)
plt.xlim((0, 100))
plt.ylim((0, 100))
frames = [plot(i) for i in range(10)]
gif.save(frames, 'example.gif', duration=50)
Examples
Warning
Altair and Plotly are no longer supported in 22.5.0
+
Please use pip install gif==3.0.0
if you still need to interface with these libraries