-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Set widget background color to white. #9698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
super(FigureCanvasQT, self).__init__(figure=figure) | ||
|
||
figure._original_dpi = figure.dpi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the super chain no longer use _original_dpi
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT the only places it is accessed are _update_figure_dpi (which is called later) and print_figure (which is irrelevant here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this got sorted out as part of the initial draw / re-entrant paint fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just need to rebase to resolve the conflict.
Done. Also removed _onEraseBackground from wx, which I forgot to do together with https://github.com/matplotlib/matplotlib/pull/9697/files#diff-19c3295dfd86eed49da406f5e5296055L687. |
The background color of the widget can be seen by setting a transparent figure facecolor, e.g. from pylab import * rcParams["figure.facecolor"] = (0, 0, 0, 0); gca(); show() The goal is to ultimately replace setting `savefig.transparent` by `figure.facecolor = (0, 0, 0, 0)`. As far as I can tell, gtk3 already defaults to a white background. Not sure what the situation is on OSX.
Actually I guess the situation on gtk depends on the desktop theme; it doesn't work on a dark theme for me. A fix is at #19410. |
PR Summary
Set widget background to white.
The background color of the widget can be seen by setting a transparent
figure facecolor, e.g.
The goal is to ultimately replace setting
savefig.transparent
byfigure.facecolor = (0, 0, 0, 0)
.(see #9080 for example for the slight trickiness of savefig.transparent).
As far as I can tell, gtk3 already defaults to a white background. Not
sure what the situation is on OSX.
PR Checklist