ipympl icon indicating copy to clipboard operation
ipympl copied to clipboard

MS Edge (non-Chromium): jupyter-matplotlib plots not showing in JupyterLab

Open pythonic2020 opened this issue 5 years ago • 7 comments

Hello, this is my first GitHub post. I just installed ipympl and can't get it to work properly in JupyterLab. The widget controls are there, but plot is blank. Plot coordinates are updated when mouse is moved around in the plot area. It works fine in Jupyter notebooks.

Setup (Win 10 x64, Anaconda):

conda list jupyter
# packages in environment at C:\Users\me\Anaconda3\envs\jupmpl:
#
# Name                    Version                   Build  Channel
jupyter                   1.0.0                    py37_7
jupyter_client            5.3.4                    py37_0
jupyter_console           6.1.0                      py_0
jupyter_core              4.6.1                    py37_0
jupyterlab                1.2.6              pyhf63ae98_0
jupyterlab_server         1.0.6                      py_0
jupyterthemes             0.20.0                   pypi_0    pypi
jupyter labextension list
JupyterLab v1.2.6
Known labextensions:
   app dir: C:\Users\me\Anaconda3\envs\jupmpl\share\jupyter\lab
        @bokeh/jupyter_bokeh v1.1.1 enabled  ok
        @jupyter-widgets/jupyterlab-manager v1.1.0 enabled  ok
        jupyter-matplotlib v0.5.0 enabled  ok
conda -V
conda 4.8.2
conda list 'python|conda|ipympl|nodejs|ipywidgets|widgetsnbextension|notebook|matplotlib'
# packages in environment at C:\Users\me\Anaconda3\envs\jupmpl:
#
# Name                    Version                   Build  Channel
_anaconda_depends         2019.03                  py37_0
anaconda                  custom                   py37_1
anaconda-client           1.7.2                    py37_0
anaconda-navigator        1.9.7                    py37_0
anaconda-project          0.8.4                      py_0
conda-package-handling    1.6.0            py37h62dcd97_0
conda-verify              3.4.2                      py_1
ipympl                    0.4.1                      py_0    conda-forge
ipython                   7.12.0           py37h5ca1d4c_0
ipython_genutils          0.2.0                    py37_0
ipywidgets                7.5.1                      py_0
matplotlib                3.1.3                    py37_0
matplotlib-base           3.1.3            py37h64f37c6_0
msgpack-python            0.6.1            py37h74a9793_1
msys2-conda-epoch         20160418                      1
nodejs                    13.8.0                        0    conda-forge
notebook                  6.0.3                    py37_0
python                    3.7.6                h60c2a47_2
python-dateutil           2.8.1                      py_0
python-libarchive-c       2.8                     py37_13
widgetsnbextension        3.5.1                    py37_0

I followed install directions as on the jupyterlab-matplotlib GitHub site, and am using the matplotlib Jupyter magic:

%matplotlib widget

jlab

Note that I can get working interactive 3d plots in external windows by invoking %pylab or %matplotlib from JupyterLab. But I get no plots inline.

I have messed around with this for many hours and am getting nowhere. Any help would be greatly appreciated! :-)

pythonic2020 avatar Feb 14 '20 02:02 pythonic2020

Do you have a JavaScript error in the console? (ctrl + shift + J on Chrome/Chromium, ctrl + shift + K on Firefox)

Also, could it be related to the theme you are using? What happens if you use the default theme?

martinRenou avatar Feb 14 '20 07:02 martinRenou

Thank you for your reply. I'm using MS Edge as default browser. The original, non-Chromium version. JupyterLab light theme results in same problem. Yes, I have JS errors. See this image:

jserror

pythonic2020 avatar Feb 14 '20 15:02 pythonic2020

Did you try reinstalling the labextensions?

jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib

Don't forget to restart the server/hard refresh the page after that.

martinRenou avatar Feb 14 '20 15:02 martinRenou

Guess what? If I make Firefox my default browser, I get this:

Untitled

Interactive plot works perfectly! But I still get some JavaScript errors...

Perhaps it's time to dump MS Edge?

pythonic2020 avatar Feb 14 '20 15:02 pythonic2020

MS Edge?

I will not try to convince you about not doing it... Maybe the Chromium-based one works fine though. Thanks for sharing this! I did not know some widgets do not work on MS Edge.

martinRenou avatar Feb 14 '20 15:02 martinRenou

Yesterday I tried re-installing the labextensions and refreshing Edge several times, to no avail. But I will keep looking into this, and report on Edge vs. Firefox behavior if I run into any problems...

pythonic2020 avatar Feb 14 '20 15:02 pythonic2020

On a side note, I am amazed at the massive increase in general jupyterlab performance using Firefox compared to MS Edge (original). It's like I'm using a new computer! It's likely those JS errors in Edge were really slowing JupyterLab down.

pythonic2020 avatar Feb 14 '20 19:02 pythonic2020