jupyter/qtconsole

Matplotlib Crashes when using "auto" backend

bcolsen opened this issue · 1 comments

Matplotlib produces a black window and then crashed when using "auto" backend

This could be linked to spyder-ide/spyder#15269

Using Ubuntu 20.04

Jupyter QtConsole 5.3.2
Python 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:03) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.31.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %matplotlib auto
   ...: import matplotlib.pyplot as plt
   ...: plt.plot([1,2,3])   # Black figure window displayed. Closing the window ends in a force quit.
Using matplotlib backend: <object object at 0x7f41a13601e0>
Out[1]: [<matplotlib.lines.Line2D at 0x7f418c065460>]

5.1.1 also crashes

Jupyter QtConsole 5.1.1
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %matplotlib auto
   ...: import matplotlib.pyplot as plt
   ...: plt.plot([1,2,3])   # Black figure window displayed. Closing the window ends in a force quit.
Using matplotlib backend: <object object at 0x7fc4a91561d0>
Out[1]: [<matplotlib.lines.Line2D at 0x7fc4a078ec10>]

In [2]: 

Still crashes with the latest packages

Jupyter QtConsole 5.4.0
Python 3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:18:27) [GCC 10.4.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %matplotlib auto
   ...: import matplotlib.pyplot as plt
   ...: plt.plot([1,2,3])  # Black figure window displayed. Closing the window ends in a force quit.
Using matplotlib backend: <object object at 0x7fa7e48c3200>
Out[1]: [<matplotlib.lines.Line2D at 0x7fa731d8fad0>]

In [2]: from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR
   ...: print("Qt: v", QT_VERSION_STR, "\tPyQt: v", PYQT_VERSION_STR)
Qt: v 5.15.6 	PyQt: v 5.15.7

In [2]: import matplotlib

In [4]: matplotlib.__version__
Out[4]: '3.6.1'