Skip to main content
gif
Downloads

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 hop.gif phone.gif
seinfeld.gif spiral.gif heart.gif

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

Release files for gif 23.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gif 23.3.0
File Size Uploaded
gif-23.3.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gif 23.3.0
File Interpreter ABI Platform
gif-23.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / gif-23.3.0.tar.gz

Download URL gif-23.3.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9e4ef83620277dd7e81b016931684b544e5751c17d6db18b820399c7c74e04ee
BLAKE2b-256 checksum
How to use checksums
c336eb714cc959b03bfc3ac66f0da62d6fea058196b378286d6c196e30d2062a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / gif-23.3.0-py3-none-any.whl

Download URL gif-23.3.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d29f5a855e55d2510748618009830cb0939f56de7eeafb0e64bd1413c57af0b8
BLAKE2b-256 checksum
How to use checksums
f660f017248efc143ce37a2a487657dd75e85db5f51d88e5e9794dad79849d21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

23.3.0 This release

2 release files

22.5.0

2 release files

3.0.0

1 release file

2.0.0

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page