浏览代码

Merge branch 'main' of github.com:zauberzeug/nicegui into main

Rodja Trappe 4 年之前
父节点
当前提交
0df4d1b073
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      main.py

+ 2 - 2
main.py

@@ -78,13 +78,13 @@ with ui.row():
             global x, y, line
             with plot:
                 x = [*x, datetime.now()][-50:]
-                y = [*y, np.sin(0.1 * datetime.now().timestamp()) + 0.02 * np.random.randn()][-50:]
+                y = [*y, np.sin(0.5 * datetime.now().timestamp()) + 0.02 * np.random.randn()][-50:]
                 line.set_xdata(x)
                 line.set_ydata(y)
                 plt.xlim(min(x), max(x))
                 plt.ylim(min(y), max(y))
 
-        ui.timer(1.0, update_plot)
+        ui.timer(0.5, update_plot)
 
     with ui.card():
         ui.label('Line Plot', 'h5')