Browse Source

update ui.plot when leaving its context

Falko Schindler 2 years ago
parent
commit
0d7392c00b
1 changed files with 1 additions and 2 deletions
  1. 1 2
      nicegui/elements/plot.py

+ 1 - 2
nicegui/elements/plot.py

@@ -24,11 +24,10 @@ class Plot(Element):
 
     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()