Library for generate gif or video from plots
Project description
Examples
sigmoid function
import matplotlib.pyplot as plt
from animateplot import AnimatePlot as Ap
import numpy as np
plt.style.use('seaborn')
def sig(x):
return 1/(1+np.exp(-x))
x = np.linspace(-10,10,100)
y = sig(x)
def call_plt(it,plt):
plt.plot(x[:it],y[:it])
plt.title('sigmoid function')
plt.xlabel('x')
plt.ylabel('y')
plt.xlim(-10,10)
plt.ylim(0,1)
return plt
anime = Ap(x,callback_plot=callback_plot)
anime.render_cache()
anime.render_mp4('sigmoid.mp4',fps=15)
results:
Example 2
from animateplot import AnimatePlot as ap
import numpy as np
x = np.linspace(0,10,100)
def call(i,plt):
s = x[:i]
plt.xlim(x[0],x[-1])
plt.ylim(x[0]**2,x[-1]**2)
plt.plot(s,s**2)
return plt
animat = ap(x,call)
animat.render_cache()
animat.render_mp4(path_video="test_2.mp4",fps=15)
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file animateplot-0.4.10-py3-none-any.whl.
File metadata
- Download URL: animateplot-0.4.10-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3411eee56aac85009d84e335468f3a02ebd8ea192af178bc370d5247d276d99
|
|
| MD5 |
f965e5a3923c34a6da7e0b70bf828bde
|
|
| BLAKE2b-256 |
8cab164cd61fc75bfc0e9bdee89d4a748ca8a16726178c1d1ca53f84de148101
|