jupyterlab interactive plot

JupyterLab 3.0+

  1. Install jupyterlab and ipympl.

    For pip users:

    pip install --upgrade jupyterlab ipympl
    

    For conda users:

    conda update -c conda-forge jupyterlab ipympl
    
  2. Restart JupyterLab.

  3. Decorate the cell containing plotting code with the header:

    %matplotlib widget
    
    # plotting code goes here
    

JupyterLab 2.0

  1. Install nodejs, e.g. conda install -c conda-forge nodejs.

  2. Install ipympl, e.g. conda install -c conda-forge ipympl.

  3. [Optional, but recommended.] Update JupyterLab, e.g.
    conda update -c conda-forge jupyterlab==2.2.9==py_0.

  4. [Optional, but recommended.] For a local user installation, run:
    export JUPYTERLAB_DIR="$HOME/.local/share/jupyter/lab".

  5. Install extensions:

     jupyter labextension install @jupyter-widgets/jupyterlab-manager
     jupyter labextension install jupyter-matplotlib
    
  6. Enable widgets: jupyter nbextension enable --py widgetsnbextension.

  7. Restart JupyterLab.

  8. Decorate with %matplotlib widget.

Leave a Comment