Explorar o código

update ui.plot when leaving its context

Falko Schindler %!s(int64=2) %!d(string=hai) anos
pai
achega
0d7392c00b
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  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()