Skip to content

Commit

Permalink
fig.close() uses double tap: pg sometimes throws error on 1st close
Browse files Browse the repository at this point in the history
  • Loading branch information
eldond committed Apr 27, 2018
1 parent 30dd8a5 commit f04ef7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyqtmpl/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,8 @@ def plot(*args, **kwargs):
def close(fig=None):
if fig is None:
fig = gcf()
fig.close()
try:
fig.close()
except AttributeError:
# pyqtgraph.PlotWidget.close() fails every other time it's called, so double tap for the win.
fig.close()

0 comments on commit f04ef7b

Please sign in to comment.