Skip to content

Commit

Permalink
Make a figure is always available
Browse files Browse the repository at this point in the history
Signed-off-by: Sietze van Buuren <[email protected]>
  • Loading branch information
swvanbuuren committed Jun 30, 2024
1 parent a2c717b commit 0822832
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mlpyqtgraph/ml_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def figure(*args, **kwargs):
def gcf():
""" Returns the current figure """
container = controllers.worker_refs.get('figure')
if container.current is None:
figure() # make sure we always have a figure
return container.current


Expand Down

0 comments on commit 0822832

Please sign in to comment.