gif

The matplotlib Animation Extension

Popularity
3.8
Stable
Activity
2.9
Stable
668
10
46

Description

A better way to build animated Matplotlib gifs. Just: pip install gif

Programming language: Python
License: MIT License
Latest version: v3.0.0

gif alternatives and similar packages

Based on the "Data Visualization" category.
Alternatively, view gif alternatives based on common mentions on social networks and blogs.

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.

Do you think we are missing an alternative of gif or a related project?

Add another 'Data Visualization' Package

README

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)]
# (Optional) Set the dots per inch resolution to 300
gif.options.matplotlib["dpi"] = 300
# Decorate a plot function with @gif.frame
@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))
# Construct "frames"
frames = [plot(i) for i in range(10)]
# Save "frames" to gif with a specified duration (milliseconds) between each frame
gif.save(frames, 'example.gif', duration=50)

Examples

[[arrival.gif](images/arrival.gif)](examples/arrival.py) [[hop.gif](images/hop.gif)](examples/hop.py) [[phone.gif](images/phone.gif)](examples/phone.py)
[[seinfeld.gif](images/seinfeld.gif)](examples/seinfeld.py) [[spiral.gif](images/spiral.gif)](examples/spiral.py) [[heart.gif](images/heart.gif)](heart.py)

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

Do not miss the trending, packages, news and articles with our weekly report.

Awesome Python is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
We recommend Spin The Wheel Of Names for a cryptographically secure random name picker.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /