-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
index in pick_event invalid and inconsistent for mplot3d scatter plot (z ordering?) #19735
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
Comments
The axes reverse directions on the selection depending on which points are in front when you rotate the graph. Using matplotlib 3.4.1
|
Anyone got a clue where the code is that populates the event.ind? I took linear algebra and I write python code all the time, but finding my way around this project, where should I start? |
That's determined in |
I'll take a look. meanwhile this is a work around.
|
On the bright side, via #19812 we now carry the z-sorting on the artist so we know enough to do the inversion. |
Bug report
Bug summary
The index returned in the pick_event (event.ind) does not correspond to the index of the source data.
It also changes depending on the view onto the data.
The example contains two points.
When you click on a point, the event.ind is printed out.
The one at (0,0,0) should have index 0, the other index 1.
Rotate the plot so that the second point is further behind (semi transparent). Now it has index 0.
Rotate the plot so that the second point is further in front (full opacity). Now it has index 1.
Code for reproduction
`
Actual outcome
The example contains two points.
When you click on a point, the event.ind is printed out.
The one at (0,0,0) should have index 0, the other index 1.
Rotate the plot so that the second point is further behind (semi transparent). Now it has index 0.
Rotate the plot so that the second point is further in front (full opacity). Now it has index 1.
Expected outcome
The returned event.ind should not depend on view.
For the point in the centre it should always return 0, for the point to the right, it should always return 1.
Matplotlib version
import matplotlib; print(matplotlib.__version__)
): '3.3.4'print(matplotlib.get_backend())
): 'MacOSX'The text was updated successfully, but these errors were encountered: