Library for generate gif or video from plots
Project description
Examples
Gif
import numpy as np
import matplotlib.pyplot as ply
from animateplot import AnimatPlot # import AnimatPlot
x = np.linspace(-10,10,200)
np.seterr(all="ignore")
def sig(x):
return 1/(1+np.exp(-x))
def call_plt(plt,y,x):
plt.style.use('seaborn')
plt.plot(x,y)
plt.title('sigmoid function')
plt.xlabel('x')
plt.ylabel('y')
plt.xlim(-10,10)
plt.ylim(0,1)
return plt
def test_render_gif():
anime = AnimatPlot(sig,x,callback_plot=call_plt)
anime.delete_cache()
anime.render_cache()
anime.render_gif('tests/gifs/sigmoid.gif')
test_render_gif()
logs:
ended saved cache images!
[200 images saved in 30.9s | speed: 6.5/img/s | ping: 15.5ms]
[Figure size 576x396 with 0 Axes]
saving the files from cache:
anime.render_gif(path='plot.gif',fps=8.7)
logs: plot.gif saved in 6.8s
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for animateplot-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 766bcf52a1abda5cb5fb4e988066fc5a170078939cd2634311b86ed76e9e7adc |
|
MD5 | 7520680a3fd4471ce7eaa8b16511295b |
|
BLAKE2b-256 | 5983dae7784c98f7ed6e9222a6b5160f3057d12bd2611e42c68c371b884739c3 |