mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
pandas plot interactive
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user