A simple package to streamline Matplotlib animations.
Project description
ez-animate
A high-level, declarative Python package for creating common Matplotlib animations with minimal boilerplate code.
Project Goals
ez-animate aims to make it easy for data scientists, analysts, educators, and researchers to create standard Matplotlib animations quickly and with minimal code. It abstracts away the complexity of FuncAnimation, state management, and repetitive setup, letting you focus on your data and story.
Why?
- Complex Setup: No need to write custom
initandupdatefunctions. - State Management: Simplifies handling data and artist states between frames.
- Repetitive Code: Reduces boilerplate for standard animations.
Who is it for?
- Primary: Data scientists & analysts (exploratory analysis, presentations, notebooks).
- Secondary: Students, educators, and researchers (learning, teaching, publications).
Features
- Simple API: Create animations with a few lines of code.
- Tested & Linted: High code quality with
pytestandruff. - Documentation: See documentation for usage examples and API references.
Installation
pip install ez-animate
Quickstart
from ez_animate import RegressionAnimation
# Create and run the animation
animator = RegressionAnimation(
model=Lasso, # Scikit-learn or sega_learn model class
X=X,
y=y,
test_size=0.25,
dynamic_parameter="alpha",
static_parameters={"max_iter": 1, "fit_intercept": True},
keep_previous=True,
metric_fn=Metrics.mean_squared_error,
)
# Set up the plot
animator.setup_plot(
title="Regression Animation",
xlabel="Feature Coefficient",
ylabel="Target Value",
)
# Create the animation
animator.animate(frames=np.arange(0.01, 1.0, 0.01))
# Show and save the animation
animator.show()
animator.save("regression_animation.gif")
Full Documentation
See the documentation site for complete usage instructions, API references, and examples.
Development/Contributing
See DEVELOPMENT.md for full development and contributing guidelines.
Project Structure
ez-animate/
├─ .github/
│ ├─ ISSUE_TEMPLATE
│ └─ workflows
├─ examples/
│ ├─ plots
│ ├─ sega_learn
│ └─ sklearn
├─ src/
│ └─ ez_animate
└─ tests
License
This project is licensed under the terms of the MIT License.
Acknowledgments
- Built with inspiration from the Matplotlib community.
- Thanks to all contributors!
Example GIFs
Stochastic Gradient Descent (SGD) Regression
Here's an example of a Stochastic Gradient Descent (SGD) regression animation created using ez-animate. This animation shows how the fit and the metrics evolve over time as the model learns from the data.
K-Means Clustering
Here's an example of a K-Means clustering animation created using ez-animate. This animation shows how the cluster centroids and the data points evolve over time as the algorithm iteratively refines the clusters.
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
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 ez_animate-0.1.1.tar.gz.
File metadata
- Download URL: ez_animate-0.1.1.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53f50484fe5544ef1d65f6ee042d385827fb0634398205980377690bb07f907a
|
|
| MD5 |
80557f6ecb377d0c78d64edeabb9cf69
|
|
| BLAKE2b-256 |
1593669644fc5d918fd9ac8da45e39d35333c132176db9abae61f87809dcba7e
|
File details
Details for the file ez_animate-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ez_animate-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dce6c3993c9ed2e42e69c07593d05c7d66f85cf5680108be8576afaa40a1eb1
|
|
| MD5 |
7929c101abf50df3f124f27be74fd4b5
|
|
| BLAKE2b-256 |
603f4be7e2ca08b117d96c01074c8ba8956c94d1d821f3909cc29362b1a7bc64
|