Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/matplotlib/backends/backend_gtk3agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from . import backend_agg, backend_cairo, backend_gtk3
from ._gtk3_compat import gi
from .backend_cairo import cairo
from .backend_gtk3 import _BackendGTK3
from .backend_gtk3 import Gtk, _BackendGTK3
from matplotlib import transforms

# The following combinations are allowed:
Expand Down Expand Up @@ -38,6 +38,10 @@ def on_draw_event(self, widget, ctx):

if not len(self._bbox_queue):
self._render_figure(w, h)
Gtk.render_background(
self.get_style_context(), ctx,
allocation.x, allocation.y,
allocation.width, allocation.height)
bbox_queue = [transforms.Bbox([[0, 0], [w, h]])]
else:
bbox_queue = self._bbox_queue
Expand Down
5 changes: 4 additions & 1 deletion lib/matplotlib/backends/backend_gtk3cairo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from . import backend_cairo, backend_gtk3
from ._gtk3_compat import gi
from .backend_cairo import cairo
from .backend_gtk3 import _BackendGTK3
from .backend_gtk3 import Gtk, _BackendGTK3
from matplotlib.backend_bases import cursors


Expand Down Expand Up @@ -39,6 +39,9 @@ def on_draw_event(self, widget, ctx):
# toolbar.set_cursor(cursors.WAIT)
self._renderer.set_context(ctx)
allocation = self.get_allocation()
Gtk.render_background(
self.get_style_context(), ctx,
allocation.x, allocation.y, allocation.width, allocation.height)
self._render_figure(allocation.width, allocation.height)
# if toolbar:
# toolbar.set_cursor(toolbar._lastCursor)
Expand Down