CERN Accelerating science

Ipympl

Hello,

Does somebody have an experience with the Matplotlib Jupyter extension a.k.a. ipympl in SWAN? Following the instructions here, I used pip to install this package into my CERNBox and adjusted $PYTHONPATH accordingly. However, if I run the following cell

%matplotlib widget
from matplotlib import pyplot as plt
plt.plot(range(5))

I get a list of Line2D as the output instead of a figure being shown. This code runs as expected in a jupyter notebook on my laptop. Is there anything I need to configure specially for SWAN?

I noticed that the output of jupyter nbextension list includes jupyter-matplotlib/extension on my machine but not on SWAN. This should mean that the extension needs to be installed for the notebook (although the installation instructions for ipympl do not mention this). But then

jupyter nbextension install --py --user ipympl

attempts to write to /cvmfs/. Does this mean it is not possible to install the extension in CERNBox?

Turns out, I needed to go to ‘Nbextensions configuration’ and uncheck ‘disable configuration for nbextensions without explicit compatibility’. Now figures are displayed, and I can interact with them. However, the interface is a bit buggy (e.g. the zoom box does not start at the point I click). But this is probably good enough.