Skip to content

Commit

Permalink
update ui.plot when leaving its context
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Oct 27, 2022
1 parent 2450748 commit 0d7392c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nicegui/elements/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ def __init__(self, *, close: bool = True, **kwargs):

def __enter__(self):
plt.figure(self.fig)

return self

def __exit__(self, *_):
self.view.set_figure(plt.gcf())

if self.close:
plt.close(self.fig)
self.update()

0 comments on commit 0d7392c

Please sign in to comment.