Leveraging the Jupyter interactive widgets framework, ipympl
enables the interactive features of matplotlib in the Jupyter notebook and in JupyterLab.
Besides, the figure canvas
element is a proper Jupyter interactive widget which can be positioned in interactive widget layouts.
To enable the ipympl
backend, simply use the matplotlib
Jupyter
magic:
%matplotlib widget
conda install -c conda-forge ipympl
# If using JupyterLab
conda install -c conda-forge nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib
pip install ipympl
# If using JupyterLab
# Install nodejs: https://nodejs.org/en/download/
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib
git clone https://github.com/matplotlib/ipympl.git
cd ipympl
pip install -e .
# If using classic Jupyter Notebook
jupyter nbextension install --py --symlink --sys-prefix ipympl
jupyter nbextension enable --py --sys-prefix ipympl
# If using JupyterLab
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build
jupyter labextension link ./js
cd js && npm run watch
# Launch jupyterlab as `jupyter lab --watch` in another terminal