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/test4_multiple_y_axes.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/test4_multiple_y_axes.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Test_Plots/test4_multiple_y_axes.py b/src/Test_Plots/test4_multiple_y_axes.py new file mode 100644 index 0000000..ebaac7e --- /dev/null +++ b/src/Test_Plots/test4_multiple_y_axes.py @@ -0,0 +1,25 @@ +import dearpygui.dearpygui as dpg + +dpg.create_context() + +with dpg.window(label="Tutorial", width=400, height=400): + with dpg.plot(label="Bar Series", height=-1, width=-1): + dpg.add_plot_legend() + + # create x axis + dpg.add_plot_axis(dpg.mvXAxis, label="Student", no_gridlines=True) + dpg.set_axis_ticks(dpg.last_item(), (("S1", 11), ("S2", 21), ("S3", 31))) + + # create y axis + dpg.add_plot_axis(dpg.mvYAxis, label="Score", tag="yaxis_tag") + + # add series to y axis + dpg.add_bar_series([10, 20, 30], [100, 75, 90], label="Final Exam", weight=1, parent="yaxis_tag") + dpg.add_bar_series([11, 21, 31], [83, 75, 72], label="Midterm Exam", weight=1, parent="yaxis_tag") + dpg.add_bar_series([12, 22, 32], [42, 68, 23], label="Course Grade", weight=1, parent="yaxis_tag") + +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 |