Title: RectangleSelector does not work if start and end points are identical · Issue #10075 · matplotlib/matplotlib · GitHub
Open Graph Title: RectangleSelector does not work if start and end points are identical · Issue #10075 · matplotlib/matplotlib
X Title: RectangleSelector does not work if start and end points are identical · Issue #10075 · matplotlib/matplotlib
Description: Bug report If in a RectangleSelector the mouse does not move between button press and button release, wrong values for start and end coordinates are returned. It seems to me that those coordinates correspond to the last callback where th...
Open Graph Description: Bug report If in a RectangleSelector the mouse does not move between button press and button release, wrong values for start and end coordinates are returned. It seems to me that those coordinates ...
X Description: Bug report If in a RectangleSelector the mouse does not move between button press and button release, wrong values for start and end coordinates are returned. It seems to me that those coordinates ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/10075
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RectangleSelector does not work if start and end points are identical","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**If in a RectangleSelector the mouse does not move between button press and button release, wrong values for start and end coordinates are returned. It seems to me that those coordinates correspond to the last callback where the mouse had been moved between press and release.**\r\n\r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\r\n\r\n**The following example code in the [Matplotlib documentation](https://matplotlib.org/api/widgets_api.html) illustrates the consequences:**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\n```from matplotlib.widgets import RectangleSelector\r\nfrom pylab import *\r\n\r\ndef onselect(eclick, erelease):\r\n 'eclick and erelease are matplotlib events at press and release'\r\n print(' startposition : (%f, %f)' % (eclick.xdata, eclick.ydata))\r\n print(' endposition : (%f, %f)' % (erelease.xdata, erelease.ydata))\r\n print(' used button : ', eclick.button)\r\n\r\ndef toggle_selector(event):\r\n print(' Key pressed.')\r\n if event.key in ['Q', 'q'] and toggle_selector.RS.active:\r\n print(' RectangleSelector deactivated.')\r\n toggle_selector.RS.set_active(False)\r\n if event.key in ['A', 'a'] and not toggle_selector.RS.active:\r\n print(' RectangleSelector activated.')\r\n toggle_selector.RS.set_active(True)\r\n\r\nx = arange(100)/(99.0)\r\ny = sin(x)\r\nfig = figure\r\nax = subplot(111)\r\nax.plot(x,y)\r\n\r\ntoggle_selector.RS = RectangleSelector(ax, onselect, drawtype='line')\r\nconnect('key_press_event', toggle_selector)\r\nshow()\r\n```\r\n\r\n**If you start with drawing a line, everything works fine. If you then move the mouse to a different point, click it and release it without moving, the previous line shows up again (and the old coordinates are printed to stdout). If you draw a line from upper left to lower right, the detached line makes weird movements.\r\n\r\nThe example program works correctly with Matplotlib version 1.4.2.\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Windows 7 Professional 64bit\r\n * Matplotlib version: 2.1.1\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): qt5agg\r\n * Python version: 3.6.3\r\n * Jupyter version (if applicable): - \r\n * Other libraries: -\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\nI installed matplotlib with miniconda from the default channel.\r\n","author":{"url":"https://github.com/Rolf-Hempel","@type":"Person","name":"Rolf-Hempel"},"datePublished":"2017-12-22T15:09:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/10075/matplotlib/issues/10075"}
| 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:7e7c46a5-bb0b-e63a-9a1d-87f110eee558 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B680:7F3E2:1591CB5:1F423A1:6A54CB6D |
| html-safe-nonce | 32353c2986c33b41180e2782f6e4e71635e5919198870754beca109b28aa1969 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjgwOjdGM0UyOjE1OTFDQjU6MUY0MjNBMTo2QTU0Q0I2RCIsInZpc2l0b3JfaWQiOiI3ODQ1NDEzNzMzOTg4MDkyNzgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a2536c28a03486e20fe7a91a7de5afc77aa36de084f67033d93385a1511dc7a5 |
| hovercard-subject-tag | issue:284185030 |
| 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/10075/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5be03d86f652ff2d007aa6810803e29439b9318c9ee693d409a1f31934d388cc/matplotlib/matplotlib/issues/10075 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5be03d86f652ff2d007aa6810803e29439b9318c9ee693d409a1f31934d388cc/matplotlib/matplotlib/issues/10075 |
| og:image:alt | Bug report If in a RectangleSelector the mouse does not move between button press and button release, wrong values for start and end coordinates are returned. It seems to me that those coordinates ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Rolf-Hempel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6e5f2e6ff3f430aa60a674066f957bca9f2106017e1b68126417422b58ce6e1e |
| 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 | be4d48619391052c9d312c7b587bb2ac38a97f57 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width