-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Bad event index for step plots #6615
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
I am in favor of adding a step should probably map back to the orginal index? |
Turns out #6497 has an additional issue, where lines of length >1000 ignore the drawstyle due to the subslicing optimization
A call to Either the subslicing indices should be fixed, or possibly (the simpler solution?) we can just revert #6497, rely on the previous method on plotting, and cache the actually plotted path under a new name for containment checking. |
matplotlib#6497 set the `_path` attribute of Line2D to the actually drawn path even if the drawstyle is `steps-*`; however containment tests and the subslice optimization for very long paths were not updated accordingly (see matplotlib#6615). This patch fixes the issues. Note that `contains` returns, for events in a horizontal segment of a "steps-mid" drawstyle plot, the index of the point in the segment, regardless of whether the event occured to the left or the right of that point.
Closed by #6645. |
#6497 (checked by bisection) let to pick events reporting incorrect events for step plots.
MWE:
On 1.5.1, clicking on the "right" part of the plot reports an index close to 100 (that is, the number of points). On master, the index is instead close to 200 (because each point is "duplicated" in the path).
While the previous behavior could "easily" be restored, it may be a good time to revisit what the "index" returned by
Line2D.contains
actually means. Specifically:The text was updated successfully, but these errors were encountered: