diff options
author | Nao Pross <np@0hm.ch> | 2021-11-11 19:21:33 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-11-11 19:21:33 +0100 |
commit | 0ad4b5f2b78e199dae017fdb6cb80fca39102e5a (patch) | |
tree | 9dfd95ba31d63441cf27444fd412498f745f136a /src/Test_Plots/test2_axis_limis.py | |
parent | Add more references (diff) | |
download | Fading-0ad4b5f2b78e199dae017fdb6cb80fca39102e5a.tar.gz Fading-0ad4b5f2b78e199dae017fdb6cb80fca39102e5a.zip |
Rename sketch.py to gui.py, move tests in test/ directory
Diffstat (limited to 'src/Test_Plots/test2_axis_limis.py')
-rw-r--r-- | src/Test_Plots/test2_axis_limis.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/Test_Plots/test2_axis_limis.py b/src/Test_Plots/test2_axis_limis.py deleted file mode 100644 index bdfeda1..0000000 --- a/src/Test_Plots/test2_axis_limis.py +++ /dev/null @@ -1,40 +0,0 @@ -import dearpygui.dearpygui as dpg -from math import sin, cos - -dpg.create_context() - -sindatax = [] -sindatay = [] -for i in range(0, 500): - sindatax.append(i / 1000) - sindatay.append(0.5 + 0.5 * sin(50 * i / 1000)) - -def update_series(): - - cosdatax = [] - cosdatay = [] - for i in range(0, 500): - cosdatax.append(i / 1000) - cosdatay.append(0.5 + 0.5 * cos(50 * i / 1000)) - dpg.set_value('series_tag', [cosdatax, cosdatay]) - dpg.set_item_label('series_tag', "0.5 + 0.5 * cos(x)") - -with dpg.window(label="Tutorial", tag="win"): - dpg.add_button(label="Update Series", callback=update_series) - # 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", tag="series_tag") - -dpg.create_viewport(title='Custom Title', width=800, height=600) -dpg.setup_dearpygui() -dpg.show_viewport() -dpg.start_dearpygui() -dpg.destroy_context() |