JupyterHub and interactive matplotlib (Qt5Agg) (original) (raw)
I am currently working on jupyter notebook based on matplotlib with the interactive features enabled thanks to Qt, using:
import matplotlib
matplotlib.use(‘Qt5Agg’)
This works perfectly on my local istance of JupyterHub, but I would need to use it on a jupyter notebook running on a remote server and that seems to be impossible using Qt5Agg.
My questions are the following:
- is there a new solution to this issue regarding matlplotlib and Qt5Agg on Jupyter Hub in remote instance?
- if there are no new solutions, which is the recommended solution that should be adopted? for example I have found that for google colab there is a work around of it, but I found it hard to get the equivalent solution for JupyterHub.
- would it be possible to have maps with matplotlib without using Qt5Agg hence avoiding that major issue. Even moving from matplotlib to another library would be a good solution if the interactivity were mantained.
Thanks for the support
You could try the ipympl
Matplotlib backend, which renders plots directly in notebooks rather than in separate windows, and is fully interactive. The documentation is at https://matplotlib.org/ipympl/
antoveco March 26, 2025, 8:14am 3
hi!! I found that solution, but I wonder if it provides the level of interactivity I need, in my case I would need to interact with a raster displayed in the notebook where I can select certain points and retrieve their coordinates to make further computations. Is ipympl suitable for that? I have found no examples about it. Thanks for your support
Antonio