Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lorcat opened this issue Oct 22, 2021 · 9 comments
Labels
state: pending not addressed yet

Comments

@lorcat
Copy link

lorcat commented Oct 22, 2021

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 lorcat added the state: pending not addressed yet label Oct 22, 2021
@yonvqn
Copy link

yonvqn commented Oct 22, 2021

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

@hoffstadt
Copy link
Owner

Is this what you are looking for?

@lorcat
Copy link
Author

lorcat commented Oct 25, 2021

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
Copy link

ry-dgel commented Apr 25, 2022

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
Copy link
Owner

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
Copy link

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
Copy link

Hi @hoffstadt was this feature ever added?

@L-Nafaryus
Copy link

L-Nafaryus commented Nov 14, 2023

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

@yannou38
Copy link

yannou38 commented Oct 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet
Projects
None yet
Development

No branches or pull requests

8 participants