Skip to content

Commit fbe82bb

Browse files
authored
Merge pull request #19410 from anntzer/gtkbg
Set the GTK background color to white.
2 parents 92b4bc3 + 3c83237 commit fbe82bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/backends/backend_gtk3.py

+6
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ def __init__(self, figure=None):
127127

128128
self.set_can_focus(True)
129129

130+
css = Gtk.CssProvider()
131+
css.load_from_data(b".matplotlib-canvas { background-color: white; }")
132+
style_ctx = self.get_style_context()
133+
style_ctx.add_provider(css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
134+
style_ctx.add_class("matplotlib-canvas")
135+
130136
renderer_init = _api.deprecate_method_override(
131137
__class__._renderer_init, self, allow_empty=True, since="3.3",
132138
addendum="Please initialize the renderer, if needed, in the "

0 commit comments

Comments
 (0)