Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: should I use %matplotlib widget or %matplotlib ipympl #529

Open
parmentelat opened this issue Jun 23, 2023 · 4 comments
Open

Question: should I use %matplotlib widget or %matplotlib ipympl #529

parmentelat opened this issue Jun 23, 2023 · 4 comments

Comments

@parmentelat
Copy link

the README suggests to use
%matplotlib widget

however based on a small experiment that I described also here
https://discourse.jupyter.org/t/interactive-matplotlib-in-jupyterlab-no-longer-working/20017/3?u=parmentelat

it seems like using
%matplotlib ipympl

works too, and even better in the sense that it works also in vs-code
so, which is best ?

(I have several hundreds of notebooks written with
%matplotlib notebook
and that now must be changed for jlab4/nb7 at least, so as far as possible Id like to change them only once ;-)

and thank you for the awesome tool 👍

@parmentelat
Copy link
Author

all this is, of course, unless there's any hope to have %matplotlib notebook work again in jlab4 or nb7 one day ?

@ianhi
Copy link
Collaborator

ianhi commented Apr 2, 2024

For things running off an ipykernel backend (i.e. jupyterlab) there is not difference. Other systems, like vscode, might have only chosen to support one.

widget is more consistent with naming scheme used in other backend selection magics where the generic name of hte backend system is used e..g `%matplotlib qt.

I personally have preferred ipympl as I think it leads to greater discoverability of this package. So if someone comes across a notebook using it they will have a better chance of searching for the right package to install.

@ianhi
Copy link
Collaborator

ianhi commented Apr 2, 2024

all this is, of course, unless there's any hope to have %matplotlib notebook work again in jlab4 or nb7 one day ?

As far as I can see there is no hope of this. the notebook backend works fundamentally different system to put matplotlib in the notebook, a system that for various (good) reasons is not what jupyterlab is based on. nb7 is in turn based off the jupyterlab code.

@parmentelat
Copy link
Author

I personally have preferred ipympl as I think it leads to greater discoverability of this package. So if someone comes across a notebook using it they will have a better chance of searching for the right package to install.

FWIW that's what I've gone for too, and for that exact same reason :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants