import dearpygui.dearpygui as dpg from math import sin dpg.create_context() def update_plot_data(sender, app_data, plot_data): mouse_y = app_data[1] if len(plot_data) > 100: plot_data.pop(0) plot_data.append(sin(mouse_y / 30)) dpg.set_value("plot", plot_data) data = [] with dpg.window(label="Tutorial", width=500, height=500): dpg.add_simple_plot(label="Simple Plot", min_scale=-1.0, max_scale=1.0, height=300, tag="plot") with dpg.handler_registry(): dpg.add_mouse_move_handler(callback=update_plot_data, user_data=data) dpg.create_viewport(title='Custom Title', width=800, height=600) dpg.setup_dearpygui() dpg.show_viewport() dpg.start_dearpygui() dpg.destroy_context()