hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en
MIT License
13.03k stars 678 forks source link

Setting the "auto-fit" feature for plots through the code and not through the popups #1363

Open lorcat opened 2 years ago

lorcat commented 2 years ago

Is your feature request related to a problem? Please describe. I am looking for pqtgraph alternatives for certain tasks and investigating dpg at the moment. Pyqtgraph has capability to control auto scaling of axes through code, such that this information is also synchronized with popup menus.

I am frustrated on how one can set "auto-fit" feature of the plots for x and y axes. The documentation does not seem to have this section. Could not find it in the code too.

Describe the solution you'd like I would like to see an API feature of axes items which enables "auto-fit" option, the same one which can be selected through the popup windows of the the plot.

Describe alternatives you've considered I considered using an external option testing the limits on data updates and manually readjusting the limits, but I cannot control the popup, and adding additional widgets is more like increasing entropy.

Additional context Here is the popup menu I am refering to. auto-fit

yonvqn commented 2 years ago

Hi this entry in previous discussion forum might help you? https://github.com/hoffstadt/DearPyGui_06/discussions/133

hoffstadt commented 2 years ago

Is this what you are looking for?

lorcat commented 2 years ago

Hi! Almost! Thanks for the information. So there is no support for that feature now in 1.0.2 version I am using I am indeed using the combo: dpg.set_axis_limits_auto(xaxis_id) dpg.fit_axis_data(xaxis_id)

but I still would like to see some synchronization between the popup and API😊. Maybe at some point later. Probably it will reduce some necessity for additional widgets which we need to build ourselves to control this functionality.

ry-dgel commented 2 years ago

Hi, is there any progress on this? It would be really nice to have, as the functionality is already built into implot. For live updating data, this eliminates the overhead of needing to repeatedly run fit_axis_data or set_axis_limits_auto, neither of which is permanent.

From what I understand, this feature would only require exposing the ImPlotAxisFlags_AutoFit flag of implot with an additional keyword argument to add_plot_axis

hoffstadt commented 2 years ago

For 1.7, we will be revamping the plotting API (similar to how we did the nodes in 1.6). You can expect this in 1.7 (plus a lot of other new plot related functions).

frknbhcl commented 1 year ago

Hello, is there any solution to this problem? When I use dpg.fit_axis_data as below, the checkbox is not ticked in popup menu.

image

domenick-m commented 11 months ago

Hi @hoffstadt was this feature ever added?

L-Nafaryus commented 10 months ago

It would be great to manually set the limits of the axes without locking them internally. Is it possible?

yannou38 commented 22 hours ago

with #2275 there is now a auto-fit argument for add_plot_axis: dpg.add_plot_axis(dpg.mvYAxis, label="value",parent=graph,auto_fit=True)

As of writing this there is no stable release yet but you can get it as beta: python -m pip install dearpygui=2.0.0b1