• Stars
    star
    1,502
  • Rank 30,130 (Top 0.7 %)
  • Language
    TypeScript
  • License
    BSD 3-Clause "New...
  • Created almost 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Matplotlib Jupyter Integration

ipympl

Test Status Latest PyPI version Latest conda-forge version Latest npm version Binder Gitter

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.

Usage

To enable the ipympl backend, simply use the matplotlib Jupyter magic:

%matplotlib widget

Documentation

See the documentation at: https://matplotlib.org/ipympl/

Example

See the example notebook for more!

matplotlib screencast

Installation

With conda:

conda install -c conda-forge ipympl

With pip:

pip install ipympl

Use in JupyterLab

If you want to use ipympl in JupyterLab, we recommend using JupyterLab >= 3.

If you use JupyterLab 2, you still need to install the labextension manually:

conda install -c conda-forge nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib

Install an old JupyterLab extension

If you are using JupyterLab 1 or 2, you will need to install the right jupyter-matplotlib version, according to the ipympl and jupyterlab versions you installed. For example, if you installed ipympl 0.5.1, you need to install jupyter-matplotlib 0.7.0, and this version is only compatible with JupyterLab 1.

conda install -c conda-forge ipympl==0.5.1
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected]

Versions lookup table:

ipympl jupyter-matplotlib JupyterLab Matplotlib
0.9.3 0.11.3+ 3 or 2 3.4.0>=
0.9.0-2 0.11.0-2 3 or 2 3.4.0>= <3.7
0.8.8 0.10.x 3 or 2 3.3.1>= <3.7
0.8.0-7 0.10.x 3 or 2 3.3.1>=, <3.6
0.7.0 0.9.0 3 or 2 3.3.1>=
0.6.x 0.8.x 3 or 2 3.3.1>=, <3.4
0.5.8 0.7.4 1 or 2 3.3.1>=, <3.4
0.5.7 0.7.3 1 or 2 3.2.*
... ... ...
0.5.3 0.7.2 1 or 2
0.5.2 0.7.1 1
0.5.1 0.7.0 1
0.5.0 0.6.0 1
0.4.0 0.5.0 1
0.3.3 0.4.2 1
0.3.2 0.4.1 1
0.3.1 0.4.0 0 or 1

For a development installation (requires nodejs):

Create a dev environment that has nodejs installed. The instructions here use mamba but you can also use conda.

mamba env create --file dev-environment.yml
conda activate ipympl-dev

Install the Python Packge

pip install -e .

When developing your extensions, you need to manually enable your extensions with the notebook / lab frontend. For lab, this is done by the command:

jupyter labextension develop --overwrite .
yarn run build

For classic notebook, you need to run:

jupyter nbextension install --py --symlink --sys-prefix --overwrite ipympl
jupyter nbextension enable --py --sys-prefix ipympl

How to see your changes

Typescript:

If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the widget.

# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
# Run JupyterLab in another terminal
jupyter lab

After a change wait for the build to finish and then refresh your browser and the changes should take effect.

Python:

If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.

More Repositories

1

matplotlib

matplotlib: plotting with Python
Python
19,149
star
2

cheatsheets

Official Matplotlib cheat sheets
Python
7,248
star
3

mplfinance

Financial Markets Data Visualization using Matplotlib
Python
3,253
star
4

AnatomyOfMatplotlib

Anatomy of Matplotlib -- tutorial developed for the SciPy conference
Jupyter Notebook
1,193
star
5

basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
Python
763
star
6

mpl-finance

This package is DEPRECATED, replaced by https://github.com/matplotlib/mplfinance
Python
309
star
7

cmocean

Colormap setup for standardizing commonly-plotting oceanographic variables.
Python
221
star
8

pytest-mpl

A pytest plugin to facilitate image comparison for Matplotlib figures
Python
216
star
9

viscm

A tool for visualizing and designing colormaps using colorspacious and matplotlib
Python
161
star
10

trendvis

Python
114
star
11

mplcairo

A (new) cairo backend for Matplotlib.
C++
102
star
12

cycler

cycler: composable cycles
Python
69
star
13

mpl-third-party

Third-party Packages Webpage
Python
50
star
14

grid-strategy

Library to facilitate the arrangement of matplotlib subplots based on the number of plots
Python
41
star
15

sampledoc

CSS
40
star
16

napari-matplotlib

Linking napari layers with Matplotlib plots
Python
38
star
17

matplotblog

Matplotlib blog
Jupyter Notebook
35
star
18

GettingStarted

Scipy 2019 Tutorial
Jupyter Notebook
34
star
19

mpl-probscale

Real probability scales for matplotlib
Python
33
star
20

interactive_tutorial

Interactive Matplotlib tutorial
Python
29
star
21

matplotlib.github.com

23
star
22

matplotlib-extension-cookiecutter

A fairly opinionated cookiecutter for making a Matplotlib extension
Python
21
star
23

sample_data

Python
19
star
24

natgrid

C
15
star
25

matplotview

A library for creating lightweight views of matplotlib axes.
Python
15
star
26

mpl-gui

Prototype for mpl-gui module
Python
13
star
27

mpl-altair

Matplotlib Backend for Altair Visualization Library
Python
12
star
28

legacycontour

package for providing legacy support for contour/contourf
Python
8
star
29

mpl-brochure-binder

Notebooks for a brochure binder.
Jupyter Notebook
6
star
30

data-prototype

Python
4
star
31

CZI_2019-07_mpl

TeX
4
star
32

mpl-sphinx-theme

A thin sphinx theme to customize pydata-sphinx-theme consistently cross Matplotlib projects.
HTML
4
star
33

freetypy

Fast and modern Python wrappers for freetype, written in Python/C API
Python
4
star
34

presentations

Matplotlib talks and tutorials
Jupyter Notebook
3
star
35

mpl-docker

MPL Docker image for building docs
Dockerfile
3
star
36

mpl-brochure-site

Source for the top-level landing page.
3
star
37

devdocs

Repository for snapshots of the documentation built from the current master branch. Updated by travis
HTML
3
star
38

matplotlib-cmap-template

Template package for distributing Matplotlib colormaps.
Python
3
star
39

2020-NASA-ROSES-E7

Grant proposal responding to the 2020 NASA ROSES E7 solicitation.
TeX
3
star
40

ProjectManagement

Meeting notes and other management documentation for Matplotlib
2
star
41

governance

The governance process and model for matplotlib
Python
2
star
42

CZI_2021-03_mpl

Application for CZI EOSS round 4.
TeX
1
star