Title: Bad event index for step plots · Issue #6615 · matplotlib/matplotlib · GitHub
Open Graph Title: Bad event index for step plots · Issue #6615 · matplotlib/matplotlib
X Title: Bad event index for step plots · Issue #6615 · matplotlib/matplotlib
Description: #6497 (checked by bisection) let to pick events reporting incorrect events for step plots. MWE: from pylab import * plot(rand(100), picker=5, drawstyle="steps-pre") # 5 points tolerance def on_pick(event): print(event.ind) cid = gcf().ca...
Open Graph Description: #6497 (checked by bisection) let to pick events reporting incorrect events for step plots. MWE: from pylab import * plot(rand(100), picker=5, drawstyle="steps-pre") # 5 points tolerance def on_pick...
X Description: #6497 (checked by bisection) let to pick events reporting incorrect events for step plots. MWE: from pylab import * plot(rand(100), picker=5, drawstyle="steps-pre") # 5 points tolerance d...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/6615
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bad event index for step plots","articleBody":"#6497 (checked by bisection) let to pick events reporting incorrect events for step plots.\n\nMWE:\n\n```\nfrom pylab import *\nplot(rand(100), picker=5, drawstyle=\"steps-pre\") # 5 points tolerance\ndef on_pick(event):\n print(event.ind)\ncid = gcf().canvas.mpl_connect('pick_event', on_pick)\nshow()\n```\n\nOn 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).\n\nWhile 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:\n- For non-step plots, I think the indices should actually be floats, that indicate where between which two points the projection of the click onto the line falls (for each line for which the projection is close enough), and how close to each extremity of the segment. (This would be only a minor backwards incompatibility if the returned index is used, well, to index the data: recent numpys would emit a warning about indexing with a float.)\n- For step plots, it is less clear what the correct solution is. Perhaps keeping the status quo and returning the index of the preceding point(s) would be enough.\n","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2016-06-20T21:25:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/6615/matplotlib/issues/6615"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9cd7719c-d926-c926-b3e5-bfede84eacec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ADA:18F220:290E29:39A455:6A5335D0 |
| html-safe-nonce | 12605637b038f21c27c3b9036b0d9be0275efa7d358fab8e85745fb6a00ad9ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QURBOjE4RjIyMDoyOTBFMjk6MzlBNDU1OjZBNTMzNUQwIiwidmlzaXRvcl9pZCI6IjQ4ODcwNDQ5OTc4NTIxMTY0MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 958b3880d7e9b701cb34a4f42880f141f5166a704cae411b10730f1c036357a7 |
| hovercard-subject-tag | issue:161299193 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/6615/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f3357d37101d5cc689958831b144c732fb519ab74e794d3a78cc3dffaa4aaab/matplotlib/matplotlib/issues/6615 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f3357d37101d5cc689958831b144c732fb519ab74e794d3a78cc3dffaa4aaab/matplotlib/matplotlib/issues/6615 |
| og:image:alt | #6497 (checked by bisection) let to pick events reporting incorrect events for step plots. MWE: from pylab import * plot(rand(100), picker=5, drawstyle="steps-pre") # 5 points tolerance def on_pick... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width