From 040c101671b870f9899e83447b95e7946f472e46 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Tue, 10 Oct 2017 17:44:28 +0300 Subject: [PATCH] pandas plot interactive --- .../pycharm_matplotlib_backend/backend_interagg.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/helpers/pycharm_matplotlib_backend/backend_interagg.py b/python/helpers/pycharm_matplotlib_backend/backend_interagg.py index 148785c2415e..7e2a836c278a 100644 --- a/python/helpers/pycharm_matplotlib_backend/backend_interagg.py +++ b/python/helpers/pycharm_matplotlib_backend/backend_interagg.py @@ -32,6 +32,14 @@ class Show(ShowBase): show = Show() +# from pyplot API +def draw_if_interactive(): + if matplotlib.is_interactive(): + figManager = Gcf.get_active() + if figManager is not None: + figManager.canvas.show() + + # from pyplot API def new_figure_manager(num, *args, **kwargs): FigureClass = kwargs.pop('FigureClass', Figure) @@ -61,6 +69,10 @@ class FigureCanvasInterAgg(FigureCanvasAgg): else: buffer = self.tostring_rgb() + if len(set(buffer)) <= 1: + # do not plot empty + return + render = self.get_renderer() width, height = int(render.width), int(render.height) # pass to the socket