jupyter/qtconsole

Matplotlib Qt5Agg backend is given anonymous icon when used with qtconsole on macOS

mrclary opened this issue · 3 comments

When used in an IPython console, matplotlib's Qt5Agg backend uses a matplotlib application icon. However, when used in a QtConsole, it uses an anonymous application icon.

Screenshot 2023-05-27 at 9 51 04 AM
  • macOS Ventura 13.3.1
  • Python 3.10.11
  • QtConsole 5.4.3
  • Matplotlib 3.7.1

This issue appears only for macOS; Windows 10 and Ubuntu 23.04 do not exhibit this behavior

To reproduce:

$ conda create -n env python=3.10 jupyter matplotlib
$ conda activate env
(env) $ jupyter qtconsole

Then from the QtConsole window:

In [1]: import matplotlib as mpl; mpl.use('Qt5Agg')

In [2]: import matplotlib.pyplot as plt; plt.plot(); plt.show()

What happens when you create plots in JupyterLab with the Qt backend?

What happens when you create plots in JupyterLab with the Qt backend?

Running the above commands using JupyterLab produces the same results as QtConsole, an anonymous application icon.

Ok, that means this is not a problem that can be solved here. It should probably be solved in IPykernel, but I don't know what kind of magic Matplotlib is doing to display that icon in the terminal version of IPython.

So, I suggest you to open an issue about this in Matplotlib so they can better inform you where this should be addressed and maybe how. You can ping me if you want because once it's known what they are doing in IPython terminal, it shouldn't be that hard to port that to the required project in the Jupyter architecture.