[ENH]: do_3d_projection could restore original verts order after draw() finishes · Issue #23155 · matplotlib/matplotlib · GitHub
Skip to content

[ENH]: do_3d_projection could restore original verts order after draw() finishes #23155

Description

@anntzer

Problem

do_3d_projection() reorders vertices of various 3D collection artists in z-depth. Once the drawing is done, it would be useful to restore back the original order, so that e.g. interactive tools (mplcursors) reporting the index of a picked collection member get the original index as set by the user (anntzer/mplcursors#49). This should be reasonably cheap to do as we can probably just stash the original arrays somewhere and restore them as attributes at the end.

In practice, this probably means adding another API like doing_3d_projection() which returns a contextmanager (or letting do_3d_projection() possibly return a contextmanager and doing a typecheck on that) and replacing the calls to do_3d_projection() to stack.enter_context(artist.doing_3d_projection()) where stack = ExitStack() is defined at the top of Axes3D.draw().

Proposed solution

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew featuretopic: mplot3d🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions