You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
index in pick_event invalid and inconsistent for mplot3d scatter plot (z ordering?) #19735
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.
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
Operating system: macOS Catalina; 10.15.4
Matplotlib version (import matplotlib; print(matplotlib.__version__)): '3.3.4'
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?
Activity
snaxxus commentedon Mar 31, 2021
The axes reverse directions on the selection depending on which points are in front when you rotate the graph. Using matplotlib 3.4.1
snaxxus commentedon Apr 1, 2021
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?
QuLogic commentedon Apr 2, 2021
That's determined in
Collection.contains; it's likely that there needs to be an override inPath3DCollectionto undo the effect of depth sorting.snaxxus commentedon Apr 2, 2021
I'll take a look. meanwhile this is a work around.
tacaswell commentedon Apr 2, 2021
On the bright side, via #19812 we now carry the z-sorting on the artist so we know enough to do the inversion.