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

When the mouse scrolls, how to ensure that the range of the y-axis and the range of the x-axis remain at a fixed scale. #111

Closed
XMatrixXiang opened this issue Sep 7, 2020 · 8 comments

Comments

@XMatrixXiang
Copy link

When the mouse scrolls, how to ensure that the r ange of the y-axis and the range of the x-axis remain at a fixed scale.

@epezent
Copy link
Owner

epezent commented Sep 7, 2020

It's not currently possible. Each axis will independently zoom by 10% of its own range.

We could introduce an ImPlotFlags_Equal that would constrain each axis to have the same units/pixel ratio. Would that solve the issue you are having?

@heyer2
Copy link

heyer2 commented Oct 20, 2020

@epezent This feature would be extremely useful. Locking the aspect ratio between the x- and y-axes is a staple feature of most plotting frameworks.

@epezent
Copy link
Owner

epezent commented Oct 20, 2020

Roger that. I'm looking into it.

@abey79
Copy link

abey79 commented Nov 5, 2020

This would be very useful to me if made available in Dear PyGUI (related issue: hoffstadt/DearPyGui#305).

@epezent
Copy link
Owner

epezent commented Nov 5, 2020

I have this mostly working, but in the process I've made several changes to to how axes are handled in general. So it's taking a bit longer than expected. Hope to merge soon.

@epezent
Copy link
Owner

epezent commented Nov 16, 2020

This work has been completed and merged to master. Enabled with ImPotFlags_Equal. It only constrains the primary x and y axes; auxiliary y axes are ignored.

Please review and post back if you find issues. It ended up being a bit more nuanced than I anticipated, so there may be a chance I missed an edge case.

equal1
euqal2

@dongqiceo
Copy link

i think his problem not this,he want x or y axis could be lock,or lock range ( scale factor?)

@dongqiceo
Copy link

This work has been completed and merged to master. Enabled with ImPotFlags_Equal. It only constrains the primary x and y axes; auxiliary y axes are ignored.

Please review and post back if you find issues. It ended up being a bit more nuanced than I anticipated, so there may be a chance I missed an edge case.

equal1 euqal2

i think problem is scale factor? Enabled with ImPotFlags_Equal cant fix

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

No branches or pull requests

5 participants