https://github.com/fszewczyk/plot2vid
The easiest way to create animations from plots
https://github.com/fszewczyk/plot2vid
animation matplotlib matplotlib-pyplot plot pyplot video
Last synced: 2 months ago
JSON representation
The easiest way to create animations from plots
- Host: GitHub
- URL: https://github.com/fszewczyk/plot2vid
- Owner: fszewczyk
- License: other
- Created: 2023-08-05T08:46:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-05T13:08:31.000Z (over 2 years ago)
- Last Synced: 2025-11-27T18:53:37.357Z (4 months ago)
- Topics: animation, matplotlib, matplotlib-pyplot, plot, pyplot, video
- Language: Python
- Homepage: https://pypi.org/project/plot2vid/
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plot2vid
_The easiest way to create animations using plots._
This small Python package lets you store seperate matplotlib plots to create a video.
## Installation
```
pip install plot2vid
```
## Basic Usage
```python
from plot2vid import PlotRecorder
import matplotlib.pyplot as plt
# Setup
recorder = PlotRecorder("out.mp4")
fig = plt.figure()
for i in range(90):
# Setting the plot limits
plt.xlim(0,100)
plt.ylim(0,100)
# Plotting
plt.scatter([i], [i])
# Recording the frame
recorder.add(fig)
# Clearing the plot
plt.clf()
# Storing the result
recorder.close()
```
The above code creates this video.

## Advanced Usage
You can change the different settings of the recorder.
```python
recorder = plot2vid.PlotRecorder("out.mp4", fps=20)
```
## Roadmap
- [x] Support MP4
- [ ] Support AVI
- [x] Variable FPS