-
Notifications
You must be signed in to change notification settings - Fork 1
/
deprecated.add_plot.other-parms.py
37 lines (28 loc) · 1.12 KB
/
deprecated.add_plot.other-parms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/local/bin/python3
from math import sin
import warnings
import dearpygui.dearpygui as dpg
warnings.simplefilter('always', DeprecationWarning)
dpg.create_context()
dpg.create_viewport(title=f"Test - {dpg.get_dearpygui_version()}", width=700, height=700)
with dpg.window() as wnd:
dpg.set_primary_window(dpg.last_item(), True)
x_data = [x/10 for x in range(0, 200)]
y_data = [sin(x) for x in x_data]
with dpg.plot(label="Regular plot", width=-1, height=300):
dpg.add_plot_axis(dpg.mvXAxis)
with dpg.plot_axis(dpg.mvYAxis):
dpg.add_line_series(x_data, y_data, label="Line series")
with dpg.plot(label="Deprecated", width=-1, height=300,
no_child=True,
no_highlight=True,
query_button=dpg.mvMouseButton_Left,
query_mod=dpg.mvKey_ModShift):
dpg.add_plot_axis(dpg.mvXAxis)
with dpg.plot_axis(dpg.mvYAxis):
dpg.add_line_series(x_data, y_data, label="Line series")
dpg.setup_dearpygui()
dpg.show_viewport()
# dpg.show_style_editor()
dpg.start_dearpygui()
dpg.destroy_context()