Matplotlib GIF maker
Project description
fastgif
Python package for creating a gif utilizing multiprocessing to speed up the process. The individual plots are saved in a temp directory and are afterwards cleaned. This takes into account keyboard interrupts as well.
Usage
import fastgif
import matplotlib.pyplot as plt
import numpy as np
def get_fig(idx):
x_space = np.linspace(0, 10, 30) + (idx / 20)
fig, ax = plt.subplots(dpi=150)
ax.plot(x_space, np.sin(x_space))
ax.grid()
ax.set_ylim(-1.2, 1.2)
ax.set_xlabel('x')
ax.set_ylabel('sin(x)')
fig.suptitle(f'Sine wave gif')
return fig
fastgif.make_gif(get_fig, 100, 'images/sine.gif', show_progress=True, writer_kwargs={'duration': 0.01})
Creates the following gif:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastgif-2.1.tar.gz
(7.5 kB
view details)
File details
Details for the file fastgif-2.1.tar.gz.
File metadata
- Download URL: fastgif-2.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7973902427e12e524022c00f79e7be81283272e707522d3ba774dc2a72c28393
|
|
| MD5 |
bcc9505be507a6d6289ce27e7c77417e
|
|
| BLAKE2b-256 |
b4a596f76bc6311d8f181bc1d8d2cd498672917bdac06445ca323c80ef12ce4a
|