Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Description
Bug summary
I tried doingpip install pyside6 and using matplotlib and a chart window appears, but just hangs.
Code for reproduction
importmatplotlibasmplimportmatplotlib.pyplotaspltmpl.use('QtAgg')# 'QT5Agg' also fails, 'TkAgg' works.plt.plot([1,2,3,2,3,4])plt.show()
Actual outcome
Chart window opens and hangs.
Expected outcome
Should work the same as when the backend isTkAgg.
Additional information
I'm running the code in IntelliJ and everything worked fine before I installed Qt.
I'm a newbie and a bit confused as to what exactly I need to do to use Qt as a backend. Note that I'm just exploring/learning, I don't have areason to want to use Qt over Tk or anything else.
I've readthis page on Qt bindings (the text on this page doesn't show up in the actual docs)
And also saw#19255 that seems to add support and was merged and I'm using a later version3.5.2.
And I've readthis page in the docs and it seems to imply (but not say) that all I need to do is install PySide6 and it should work.
Weirdly, if I just use the code:
importmatplotlib.pyplotaspltplt.plot([1,2,3,2,3,4])plt.show()
It works, which is weird for two reasons:
- This means that justimporting matplotlib invokes different behaviour to importing
matplotlib.pyplot. - Not importing matplotlib directly (only
pyplot) results in the message "Backend MacOSX is interactive backend. Turning interactive mode on.". Weird as I'm on Windows, and if I then runplt.get_backend()it saysQtAgg. It's all so confusing!
Operating system
Windows 11
Matplotlib Version
3.5.2
Matplotlib Backend
QtAgg, Qt5Agg
Python version
3.10.2
Jupyter version
No response
Installation
pip
