{"id":4057,"library":"ipympl","title":"Matplotlib Jupyter Extension","description":"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.","status":"active","version":"0.10.0","language":"en","source_language":"en","source_url":"https://github.com/matplotlib/ipympl","tags":["jupyter","matplotlib","interactive","plotting","widgets","visualization"],"install":[{"cmd":"pip install ipympl","lang":"bash","label":"PyPI"},{"cmd":"conda install -c conda-forge ipympl","lang":"bash","label":"Conda"}],"dependencies":[{"reason":"Core plotting library that ipympl extends.","package":"matplotlib","optional":false},{"reason":"Jupyter interactive widgets framework for interactivity.","package":"ipywidgets","optional":false},{"reason":"Required for Jupyter kernel interaction.","package":"ipykernel","optional":false}],"imports":[{"note":"ipympl is activated via a Jupyter magic command, not a direct Python import. '%matplotlib widget' also works.","wrong":"import ipympl","symbol":"%matplotlib ipympl","correct":"%matplotlib ipympl"}],"quickstart":{"code":"import matplotlib.pyplot as plt\nimport numpy as np\n\n%matplotlib ipympl\n\nfig, ax = plt.subplots()\nx = np.linspace(0, 2 * np.pi, 100)\ny = np.sin(3 * x)\nax.plot(x, y)\nplt.show()","lang":"python","description":"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."},"warnings":[{"fix":"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.","message":"For JupyterLab versions 1 or 2, `ipympl` requires manual installation of the `jupyter-matplotlib` labextension and specific version compatibility. For JupyterLab >= 3, installation via pip/conda is usually sufficient as the extension is automatically handled. Ensure your `ipympl` and `jupyter-matplotlib` versions are compatible.","severity":"breaking","affected_versions":"< 0.9.4 (JupyterLab 1/2 support), all versions with non-standard setups"},{"fix":"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.","message":"ipympl comprises both a Python (backend) and a JavaScript (frontend) component. In certain complex environments (e.g., custom Jupyter deployments, mixing environments), a version mismatch between these components can lead to non-interactive plots or errors. Always ensure both frontend and backend are from the same installation environment.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add `from google.colab import output; output.enable_custom_widget_manager()` at the beginning of your Colab notebook, before `%matplotlib ipympl`.","message":"When using `ipympl` in Google Colab, you must explicitly enable the custom widget manager before activating the Matplotlib backend, otherwise plots will not be interactive.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}