pandas plot interactive

This commit is contained in:
Ekaterina Tuzova
2017-10-10 17:48:35 +03:00
parent cee5232a5e
commit 040c101671
@@ -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