-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add simple delta cursor to toolbar for zoom mode #12948
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
base: main
Are you sure you want to change the base?
Conversation
Can you take a screenshot so we can understand what you are proposing? It’s not immediately obvious from code or description. Thanks! |
I guess I'm +0 for this (can be useful), but -1 on adding Euclidian distance, as it assumes too much about the axes, namely, that they have the same units. For example, if x is in seconds and y in meters, then the distance is meaningless (whereas delta x and delta y are still meaningful), and Matplotlib should avoid displaying meaningless values by default. |
Seems fine if it doesn't slow things down too much... |
PR updated:
|
What does this do with units on the axes (for example datetimes?) |
Doesn’t work because of format_coord(). One option is to test for datetimes and treat them specially. Is there a cleaner approach? |
I find this a bit confusing. The delta should be next to the coordinate names as in the first version. One way would be to to extend the format functions and to implement the delta-rendering there: This is just a quick idea, not really thought through. Maybe alternatively/additionally one would need complete handling of delta formatting all across the formatter mechanism. |
There should be a story on how to handle unit-full axis in general rather than special casing datetime. As cool and useful looking as this is, I am wary of merging it without at least a clear path to dealing with units. Maybe just turn this functionality off if either axis has units attached? |
I could also parse the string from format_coord() and add in the deltas. A bit hacky though.
Is there a simple way to detect this? |
No. That's too hacky and could easily get broken in the future. |
I would not trust parsing the format string as that is something users can set at run time. |
PR updated:
I think this is the best approach as the zoom rectangle is in Cartesian and knowing its dimensions won't be useful in other units (e.g. polar, lat/lon, etc.) Might be nice to handle dates, but I don't think there's currently a clean way. |
@roger- Sorry we have gone quite on this. I am pushing it to the 3.2 tag as I not sure what the current state of the discussion is. |
I think this is good as a minimal improvent for a defined and limited case. Just needs fixing the line length to placate flake8. |
This needs a rebase to fix conflicts, but it doesn't seem like there were any outstanding issues before that. |
This needs a revision: The message generating code has moved and in that function, we don't have access to the start click location Marking as medium-difficult because one has to dig though the design to find a reasonable approach for storing and accessing the click state. |
@timhoffm |
@roger- You need the click position later when processing drag events. The problem is that we don't have a good concept for storing that position. Coming up with a solution for that is the prerequisite for moving forward. It requires digging into the code and ideally a bit of design experience. |
@timhoffm Not something I can work on right now, so I'll leave this until I have time or someone else picks up the reins. |
Adds a small delta x/y cursor to the toolbar when zooming. Sorta related to #7216.
Minor GUI feature so no Pytest required (?). Flake8 looks good.
This will need some changes to work in polar mode but I’m not sure what’s the best way. Also might be useful to add the Euclidean distance (ds=xxx). Will await feedback.