{"id":24073,"library":"mpl-animators","title":"mpl-animators","description":"An interactive animation framework for matplotlib providing convenient classes to create animations with sliders and buttons. Current version 1.2.4, requires Python >=3.10. Released on PyPI with periodic updates.","status":"active","version":"1.2.4","language":"python","source_language":"en","source_url":"https://github.com/ehultee/mpl-animators","tags":["animation","matplotlib","interactive","widgets"],"install":[{"cmd":"pip install mpl-animators","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"core dependency for plotting and animation","package":"matplotlib","optional":false}],"imports":[{"note":"This is a custom subclass, not matplotlib's standard FuncAnimation. Importing from matplotlib loses interactive features.","wrong":"from matplotlib.animation import FuncAnimation","symbol":"FuncAnimation","correct":"from mpl_animators import FuncAnimation"}],"quickstart":{"code":"import matplotlib.pyplot as plt\nfrom mpl_animators import FuncAnimation\n\nfig, ax = plt.subplots()\nx = [0, 1, 2]\ny = [0, 1, 4]\nln, = ax.plot([], [], 'ro')\n\ndef update(frame):\n    ln.set_data(x[:frame], y[:frame])\n    return ln,\n\nani = FuncAnimation(fig, update, frames=3, interval=1000, repeat=False, blit=True)\nplt.show()","lang":"python","description":"Minimal interactive animation with a slider that controls the frame."},"warnings":[{"fix":"Use explicit import aliasing: from mpl_animators import FuncAnimation as InteractiveAnimation","message":"The class 'FuncAnimation' in mpl_animators shadows matplotlib's FuncAnimation. If you import both, the last import wins and may break code expecting the standard behavior.","severity":"gotcha","affected_versions":"all"},{"fix":"Set blit=False in FuncAnimation constructor if you experience blank frames.","message":"The 'blit' parameter is enabled by default in mpl_animators.FuncAnimation, which can cause issues with artists that are not explicitly returned in the update function. For simple animations, set blit=False to avoid invisible updates.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure interactive backend: import matplotlib; matplotlib.use('TkAgg') or use %matplotlib notebook in Jupyter.","message":"The library requires matplotlib backend that supports interactive widgets. If using a non-interactive backend (e.g., 'Agg'), the sliders and buttons will not appear.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from mpl_animators import FuncAnimation' (no hyphen, no capital A).","cause":"Incorrect spelling or version mismatch. The correct import is from mpl_animators import FuncAnimation (note underscore in module name).","error":"ImportError: cannot import name 'FuncAnimation' from 'mpl_animators'"},{"fix":"Run 'pip install mpl-animators==1.2.4' and then import as shown.","cause":"Installed a very old version or wrong package. mpl-animators may not be installed or is a different package.","error":"AttributeError: module 'mpl_animators' has no attribute 'FuncAnimation'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}