ipympl is a Matplotlib Jupyter Extension that leverages the Jupyter interactive widgets framework to enable interactive features of Matplotlib within Jupyter Notebooks, JupyterLab, Google Colab, and VSCode notebooks. It provides a proper Jupyter interactive widget for figure canvases, allowing them to be positioned in interactive widget layouts. The library is actively maintained with regular releases, currently at version 0.10.0.
pip install ipymplVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to activate the ipympl backend using the Jupyter magic command and create a basic interactive Matplotlib plot. Run this code in a Jupyter Notebook or JupyterLab environment to see the interactive features.
Upgrade to JupyterLab 3+ or refer to the official ipympl documentation's 'Compatibility Table' for specific `jupyter-matplotlib` versions required for older JupyterLab installations. For older JupyterLab versions, e.g., `conda install -c conda-forge nodejs jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib` might be needed.
Verify that `pip list` or `conda list` shows `ipympl` in your active kernel's environment. If issues persist, check the browser's developer console for JavaScript errors related to Jupyter widgets.
Add `from google.colab import output; output.enable_custom_widget_manager()` at the beginning of your Colab notebook, before `%matplotlib ipympl`.