From 34f9125634020bcba6d582bfe8e3b027d3465233 Mon Sep 17 00:00:00 2001 From: Ildar Akhmetgaleev Date: Wed, 5 Sep 2018 03:07:22 +0000 Subject: [PATCH] Fix AttributeError in GTK3Agg backend Fixes #12015 --- lib/matplotlib/backends/backend_gtk3agg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_gtk3agg.py b/lib/matplotlib/backends/backend_gtk3agg.py index 1d146db9164f..ef59c26060dd 100644 --- a/lib/matplotlib/backends/backend_gtk3agg.py +++ b/lib/matplotlib/backends/backend_gtk3agg.py @@ -1,5 +1,6 @@ import numpy as np +from .. import cbook from . import backend_agg, backend_cairo, backend_gtk3 from .backend_cairo import cairo from .backend_gtk3 import Gtk, _BackendGTK3 @@ -42,7 +43,7 @@ def on_draw_event(self, widget, ctx): width = int(bbox.x1) - int(bbox.x0) height = int(bbox.y1) - int(bbox.y0) - buf = backend_cairo._unmultipled_rgba8888_to_premultiplied_argb32( + buf = cbook._unmultipled_rgba8888_to_premultiplied_argb32( np.asarray(self.copy_from_bbox(bbox))) image = cairo.ImageSurface.create_for_data( buf.ravel().data, cairo.FORMAT_ARGB32, width, height)