Skip to main content

The easiest way to create animations using plots.

Project description

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

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.

ezgif-5-c21b239e33

Advanced Usage

You can change the different settings of the recorder.

recorder = plot2vid.PlotRecorder("out.mp4", fps=20)

Roadmap

  • Support MP4
  • Support AVI
  • Variable FPS

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

plot2vid-1.0.3.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

plot2vid-1.0.3-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page