A thin wrapper around the matplotlib FuncAnimation class
Project description
animplotlib
This package acts as a thin wrapper around the
matplotlib.animation.FuncAnimation class to simplify animating matplotlib
plots.
Installation
pip install animplotlib
Quickstart
Basic 2D animation example
# 2D animated plot of the fresnel integral
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sc
import animplotlib as anim
x = np.linspace(-7, 7, 5000)
y, z = sc.fresnel(x)
fig, ax = plt.subplots()
line, = ax.plot([], [], lw=2)
point, = ax.plot([], [], 'o')
ax.set_xlim(np.min(y), np.max(y))
ax.set_ylim(np.min(z), np.max(z))
ax.set_title("Animated 2D Fresnel Plot")
anim.AnimPlot(fig, line, point, y, z, plot_speed=2, l_num=len(x))
Basic 3D animation example
# 3D animated plot of the fresnel integral
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sc
import animplotlib as anim
# generate fresnel data
x = np.linspace(-7, 7, 1000)
y, z = sc.fresnel(x)
# create figure and axes - projection='3d' for 3D plot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# line and point to add the data to - three empty lists for 3D data
line, = ax.plot([], [], [], lw=1)
point, = ax.plot([], [], [], 'ro', markersize=5)
ax.set_xlim(np.min(x), np.max(x))
ax.set_ylim(np.min(y), np.max(y))
ax.set_zlim(np.min(z), np.max(z))
ax.set_title("Animated 3D Fresnel Plot")
anim.AnimPlot3D(fig, ax, line, point, x, y, z, plot_speed=5)
Documentation
License
MIT
Author
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 Distribution
animplotlib-0.2.6.tar.gz
(5.0 kB
view details)
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 animplotlib-0.2.6.tar.gz.
File metadata
- Download URL: animplotlib-0.2.6.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
712ccb02547684e24bca303767d25f53dcc773a94709528853886e120765bda5
|
|
| MD5 |
6bd164abdd997ce179d3bb4a05ddb91d
|
|
| BLAKE2b-256 |
d387d04b2e49bd2f28d19900bb2042036110b03a4309f580fc9df643db5af87d
|
File details
Details for the file animplotlib-0.2.6-py2.py3-none-any.whl.
File metadata
- Download URL: animplotlib-0.2.6-py2.py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a424d1ff5c9349ed11a5ca6b98f006f1e4e349a64135b645f6777cf32a08c90f
|
|
| MD5 |
206752ec3dc863d691305ef314894a06
|
|
| BLAKE2b-256 |
14d243a338d8a483ca86137130472820577647e633ce90dc516c16f23e78730a
|