DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

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

Open lorcat opened this issue 3 years ago • 9 comments

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

lorcat avatar Oct 22 '21 15:10 lorcat

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

yonvqn avatar Oct 22 '21 23:10 yonvqn

Is this what you are looking for?

hoffstadt avatar Oct 23 '21 02:10 hoffstadt

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.

lorcat avatar Oct 25 '21 06:10 lorcat

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

ry-dgel avatar Apr 25 '22 19:04 ry-dgel

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).

hoffstadt avatar Apr 27 '22 21:04 hoffstadt

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

frknbhcl avatar Mar 16 '23 14:03 frknbhcl

Hi @hoffstadt was this feature ever added?

domenick-m avatar Nov 05 '23 15:11 domenick-m

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

L-Nafaryus avatar Nov 14 '23 08:11 L-Nafaryus