FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Axes3D: factor out 3D coordinate guessing from format_coord() · Issue #4334 · matplotlib/matplotlib · GitHub

Repository navigation

Axes3D: factor out 3D coordinate guessing from format_coord() #4334

Closed

Description

To get the estimated (x,y,z) coordinate of a mouse event in a 3D figure we must parse these values from the string generated by Axes3D.format_coord. Wouldn't it be more useful to factor that out into a separate method (coord?) giving access to x, y, z = proj3d.inv_transform(xd, yd, z, self.M)? format_coord would then simply convert that to the formatted string.

The question of how to extract these coordinates has been asked a few times on SO:

http://stackoverflow.com/questions/6748184/matplotlib-plot-surface-get-the-x-y-z-values-written-in-the-bottom-right-cor
http://stackoverflow.com/questions/28954611/how-to-extract-3d-mouse-coordinate-on-mouse-click-in-matplotlib-in-python

and aside from duplicating the code within format_coord the best we can do is parse the values out of the generated string.

Activity

  1. tacaswell commented on Apr 14, 2015

    Member
  2. added this to the milestone on Apr 14, 2015
  3. tacaswell commented on Apr 14, 2015

    Member

    I agree it would make sense to turn from Line 1101 to the end of the function into

    def guess_xzy(self, x, y):
        ....

    and then use it within format_coord.

    @ndawe Any desire to take a crack at implementing this?

  4. ndawe commented on Apr 14, 2015

    Author

    Sure, I'll open a PR.

  5. ndawe commented on Apr 24, 2015

    Author

    Haven't forgotten... I have time this weekend.

  6. modified the milestones: , needs sorting on Oct 6, 2022
  7. modified the milestones: future releases, v3.8.0 on Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL