You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
As I wrote, the installation of ipmpl fixes the problem in the classic Jupyter notebook. And the original code snippet
import matplotlib.pyplot as plt
%matplotlib notebook
plt.plot([1,2,3],[1,2,3])
creates an interactive widget.
This however does not work in the new JupyerLab environment. There you have to use following code (which works also in the classic notebook)
%matplotlib widget
import matplotlib.pyplot as plt
plt.plot([1,2,3],[1,2,3])
Please note that the %matplotlib widget line must be executed before the matplotlib import. If matplotlib has been already loaded, restart the kernel.
Please also note that JupyterLab does not execute embedded JavaScript and thus many interactive extensions working in the classic Jupyter notebook do not work in JupyterLab anymore. This can be solved by using JupyterLab extensions.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
e.g.:
gives error:
Javascript Error: IPython is not defined
But it works in Classic Notebook view
%matplotlib widget
also doesn't work:ModuleNotFoundError: No module named 'ipympl'
I had a quick look around and it looks like it can be fixed by installing
ipympl
and maybe also the labextensionjupyterlab-manager
: https://github.com/matplotlib/jupyter-matplotlibThe text was updated successfully, but these errors were encountered: