Skip to content

Commit

Permalink
prevent plotting for opening many windows (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
peendebak authored and AdriaanRol committed Mar 29, 2018
1 parent d7bea0f commit f29ce21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autodepgraph/graph.py
Expand Up @@ -26,6 +26,7 @@ def __init__(self, name, cfg_plot_mode='svg',
"""
attr['name'] = name
self.cfg_plot_mode = cfg_plot_mode
self.cfg_plot_mode_args = {'fig': None}

_path_name = split(__file__)[:-1][0]
self.cfg_svg_filename = join(_path_name, 'svg_viewer', 'adg_graph.svg')
Expand Down Expand Up @@ -266,8 +267,11 @@ def update_monitor_mpl(self):
"""
Updates a plot using the draw_graph_mpl based on matplotlib.
"""
fig = self.cfg_plot_mode_args.get('fig', None)
if fig is not None:
plt.figure(fig)
plt.clf()
self.draw_mpl()
self.draw_mpl(plt.gca())
plt.draw()
plt.pause(.05)

Expand Down

0 comments on commit f29ce21

Please sign in to comment.