I would like to have zooming and panning options for plots generated in matplotlib on jupyter notebook. I tried installing mpld3 but importing the package doesn't generate my plots at all. Is it an issue of the version of Anaconda I'm using (Anaconda2)? What should I do to fix it? Any help is appreciated, Thank You
Asked
Active
Viewed 6,465 times
8
-
Try run magic command `%matplotlib notebook` prior to the plot. – swatchai Dec 09 '18 at 04:57
-
2For zooming and panning you need an interactive backend. Often the default settings of IPython/jupyter notebook are to show a png image of the plot; pngs are not interactive. You may use e.g. `%matplotlib qt`, `%matplotlib notebook`, `%matplotlib ipympl`. – ImportanceOfBeingErnest Dec 09 '18 at 11:20
2 Answers
0
for me, the following worked:
- install ipympl, the backend for matplotlib to draw, is interactive:
pip install ipympl
orconda install ipympl
(ipympl install in jupyter-notebook (python3)) - install ipywidgets, the jupyter stuff ipympl needs to draw:
pip install ipywidgets
orconda install ipywidgets
(IPython Notebook ipywidgets does not show) - use the matplotlib magic:
%matplotlib ipympl
related other questions:

hintze
- 544
- 2
- 13