Skip to content

Commit 3779fab

Browse files
author
Martin Fitzpatrick
committed
Fix error on pyplot initialisation in IPython
There was a bug on the pyplot initialisation that was wrongly looking for qApp in PyQt5.QtGui rather than PyQt5.QtWidgets. I've updated the init to do this correctly, which hopefully fixes the bug reported by @tacaswell
1 parent 1700282 commit 3779fab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def _backend_selection():
8787
# The mainloop is running.
8888
rcParams['backend'] = 'qt4Agg'
8989
elif 'PyQt5.QtCore' in sys.modules and not backend == 'Qt5Agg':
90-
import PyQt5.QtGui
91-
if not PyQt5.QtGui.qApp.startingUp():
90+
import PyQt5.QtWidgets
91+
if not PyQt5.QtWidgets.qApp.startingUp():
9292
# The mainloop is running.
9393
rcParams['backend'] = 'qt5Agg'
9494
elif 'gtk' in sys.modules and not backend in ('GTK', 'GTKAgg',

0 commit comments

Comments
 (0)