diff options
author | sara <sara.halter@gmx.ch> | 2021-11-06 20:11:11 +0100 |
---|---|---|
committer | sara <sara.halter@gmx.ch> | 2021-11-06 20:11:11 +0100 |
commit | 9194b5e9e4d7b72bf08d01c0fde6ff78be36215e (patch) | |
tree | 0e5bcd30ed089c0674166cbcb995ca955e7ee88b /src/Test_Plots/test1_updating_series_data.py | |
parent | An scr gearbeitet (diff) | |
download | Fading-9194b5e9e4d7b72bf08d01c0fde6ff78be36215e.tar.gz Fading-9194b5e9e4d7b72bf08d01c0fde6ff78be36215e.zip |
An graphischer Darstellung weitergearbeitet
Diffstat (limited to '')
-rw-r--r-- | src/Test_Plots/test1_updating_series_data.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Test_Plots/test1_updating_series_data.py b/src/Test_Plots/test1_updating_series_data.py new file mode 100644 index 0000000..1371008 --- /dev/null +++ b/src/Test_Plots/test1_updating_series_data.py @@ -0,0 +1,30 @@ +import dearpygui.dearpygui as dpg +from math import sin + +dpg.create_context() + +# creating data +sindatax = [] +sindatay = [] +for i in range(0, 500): + sindatax.append(i / 1000) + sindatay.append(0.5 + 0.5 * sin(50 * i / 1000)) + +with dpg.window(label="Tutorial"): + # create plot + with dpg.plot(label="Line Series", height=400, width=400): + # optionally create legend + dpg.add_plot_legend() + + # REQUIRED: create x and y axes + dpg.add_plot_axis(dpg.mvXAxis, label="x") + dpg.add_plot_axis(dpg.mvYAxis, label="y", tag="y_axis") + + # series belong to a y axis + dpg.add_line_series(sindatax, sindatay, label="0.5 + 0.5 * sin(x)", parent="y_axis") + +dpg.create_viewport(title='Custom Title', width=800, height=600) +dpg.setup_dearpygui() +dpg.show_viewport() +dpg.start_dearpygui() +dpg.destroy_context()
\ No newline at end of file |