From 7c39ed8b104feb81ed555f80ce827dd4effb74ec Mon Sep 17 00:00:00 2001 From: SPike666 Date: Fri, 27 May 2016 02:08:52 +0300 Subject: [PATCH] Update tight_layout.py Fixed warning when using tight_layout in calling get renderer --- lib/matplotlib/tight_layout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/tight_layout.py b/lib/matplotlib/tight_layout.py index 18a19370a092..ae6774ed9f1a 100644 --- a/lib/matplotlib/tight_layout.py +++ b/lib/matplotlib/tight_layout.py @@ -217,6 +217,8 @@ def get_renderer(fig): if canvas and hasattr(canvas, "get_renderer"): renderer = canvas.get_renderer() + elif canvas and hasattr(canvas, "renderer"): + renderer = canvas.renderer else: # not sure if this can happen warnings.warn("tight_layout : falling back to Agg renderer")