Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Closed as duplicate of#27590
Description
Bug summary
I noticed in a screenshot from another PR that out of the six backends displayed, only the Qt5Agg icon fails to adapt to dark mode. It remains black and blends in with the background, making it difficult to distinguish.

I believe the issue lies in the following code:
ifself.palette().color(self.backgroundRole()).value()<128:icon_color=self.palette().color(self.foregroundRole())mask=pm.createMaskFromColor(QtGui.QColor('black'),QtCore.Qt.MaskMode.MaskOutColor)pm.fill(icon_color)pm.setMask(mask)
It appears the icon is rendered as black regardless of whether theif
condition is met. This is likely caused by the linemask = pm.createMaskFromColor(QtGui.QColor('black'), QtCore.Qt.MaskMode.MaskOutColor).
Code for reproduction
importmatplotlibimportmatplotlib.pyplotaspltmatplotlib.use('Qt5Agg')fig,ax=plt.subplots(subplot_kw= {"projection" :"3d"})ax.bar3d([1,1,2,2], [1,2,1,2],0,1,1, [2,3,1,4],axlim_clip=True)plt.show()
Actual outcome

Expected outcome

Additional information
No response
Operating system
MacOS
Matplotlib Version
3.11.0
Matplotlib Backend
Qt5Agg
Python version
No response
Jupyter version
No response
Installation
None
Metadata
Metadata
Assignees
Labels
No labels