Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
roger- wants to merge5 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromroger-:cursor

Conversation

roger-
Copy link

@roger-roger- commentedDec 7, 2018
edited by jklymak
Loading

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.

ujvykmu

@jklymak
Copy link
Member

Can you take a screenshot so we can understand what you are proposing? It’s not immediately obvious from code or description. Thanks!

@roger-
Copy link
Author

Sure:https://imgur.com/UJVyKmu

@anntzer
Copy link
Contributor

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.

@jklymak
Copy link
Member

Seems fine if it doesn't slow things down too much...

@roger-
Copy link
Author

PR updated:

  1. remove non-ASCII characters
  2. changed format from(Δx=123.45 Δy=234.56) to(Δ: x=123.45 y=234.56) so it works with polar plots etc.

@tacaswell
Copy link
Member

What does this do with units on the axes (for example datetimes?)

@tacaswelltacaswell added this to thev3.1 milestoneDec 7, 2018
@roger-
Copy link
Author

Doesn’t work because of format_coord(). One option is to test for datetimes and treat them specially. Is there a cleaner approach?

@timhoffm
Copy link
Member

  1. changed format from(Δx=123.45 Δy=234.56) to(Δ: x=123.45 y=234.56) so it works with polar plots etc.

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:
def format_coord(self, x, y, is_delta=False).

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.

@tacaswell
Copy link
Member

One option is to test for datetimes and treat them specially

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?

@roger-
Copy link
Author

roger- commentedDec 8, 2018
edited by timhoffm
Loading

@timhoffm

Maybe alternatively/additionally one would need complete handling of delta formatting all across the formatter mechanism.

I could also parse the string from format_coord() and add in the deltas. A bit hacky though.

@tacaswell

Maybe just turn this functionality off if either axis has units attached

Is there a simple way to detect this?

@timhoffm
Copy link
Member

I could also parse the string from format_coord() and add in the deltas. A bit hacky though.

No. That's too hacky and could easily get broken in the future.

@tacaswell
Copy link
Member

ax.have_units() ( seehttps://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.have_units.html?highlight=have_units#matplotlib.axes.Axes.have_units )

I would not trust parsing the format string as that is something users can set at run time.

@roger-
Copy link
Author

PR updated:

  1. reverted display format
  2. only enable when there are no axis units

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.

@tacaswelltacaswell modified the milestones:v3.1.0,v3.2.0Feb 23, 2019
@tacaswell
Copy link
Member

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

@timhoffm
Copy link
Member

I think this is good as a minimal improvent for a defined and limited case.

Just needs fixing the line length to placate flake8.

@QuLogic
Copy link
Member

This needs a rebase to fix conflicts, but it doesn't seem like there were any outstanding issues before that.

@timhoffm
Copy link
Member

timhoffm commentedNov 2, 2020
edited
Loading

This needs a revision: The message generating code has moved and in that function, we don't have access to the start click location_xypress.

Marking as medium-difficult because one has to dig though the design to find a reasonable approach for storing and accessing the click state.

@timhoffmtimhoffm added the Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues labelNov 2, 2020
@roger-
Copy link
Author

@timhoffm
I could use some help with this if anyone is willing to volunteer.

@timhoffm
Copy link
Member

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

@roger-
Copy link
Author

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

timhoffm reacted with thumbs up emoji

@QuLogicQuLogic modified the milestones:v3.4.0,unassignedJan 21, 2021
@story645story645 modified the milestones:unassigned,needs sortingOct 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesstatus: needs rebasestatus: needs revisionstatus: orphaned PR
Projects
None yet
Milestone
future releases
Development

Successfully merging this pull request may close these issues.

8 participants
@roger-@jklymak@anntzer@tacaswell@timhoffm@QuLogic@story645@ImportanceOfBeingErnest

[8]ページ先頭

©2009-2025 Movatter.jp