Title: [ENH]: Remove `canvas.draw` from `widgets.Cursor.onmove` · Issue #26901 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Remove `canvas.draw` from `widgets.Cursor.onmove` · Issue #26901 · matplotlib/matplotlib
X Title: [ENH]: Remove `canvas.draw` from `widgets.Cursor.onmove` · Issue #26901 · matplotlib/matplotlib
Description: Problem A busy icon appears every time the mouse goes off the axes and the cursor is cleared. For image files ~100MB, the busy icon lasts 1-2 seconds each time. Sample code: from matplotlib.widgets import Cursor from matplotlib import py...
Open Graph Description: Problem A busy icon appears every time the mouse goes off the axes and the cursor is cleared. For image files ~100MB, the busy icon lasts 1-2 seconds each time. Sample code: from matplotlib.widgets...
X Description: Problem A busy icon appears every time the mouse goes off the axes and the cursor is cleared. For image files ~100MB, the busy icon lasts 1-2 seconds each time. Sample code: from matplotlib.widgets...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/26901
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Remove `canvas.draw` from `widgets.Cursor.onmove`","articleBody":"### Problem\n\nA busy icon appears every time the mouse goes off the axes and the cursor is cleared.\r\nFor image files ~100MB, the busy icon lasts 1-2 seconds each time.\r\n\r\nSample code:\r\n```python\r\nfrom matplotlib.widgets import Cursor\r\nfrom matplotlib import pyplot as plt\r\nfrom matplotlib import cm\r\nfrom PIL import Image\r\n\r\nfig, ax = plt.subplots()\r\n\r\nimg = Image.open(r\"Path to large image file ~100MB\")\r\nax.imshow(img, cmap=cm.gray)\r\n\r\ncursor = Cursor(ax, useblit=True, color='red', linewidth=1)\r\n\r\nplt.show()\r\n```\n\n### Proposed solution\n\nI think the behavior of not clearing the cursor when the mouse goes off the axes is acceptable.\r\nIt is also consistent with the behavior of the similar class `MultiCursor` which doesn't call `canvas.draw`.\r\n\r\nIf accepted, the following lines can be removed and `needclear` will also be removed:\r\nhttps://github.com/matplotlib/matplotlib/blob/ff552f45f2d30c76120fe0355306afac9a9dd2da/lib/matplotlib/widgets.py#L2015-L2017\r\n\r\n","author":{"url":"https://github.com/komoto48g","@type":"Person","name":"komoto48g"},"datePublished":"2023-09-23T19:03:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/26901/matplotlib/issues/26901"}
| 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:9b72250b-0ec6-7ebb-63d9-2bcbcb9e82b7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C896:ACE83:5217F5:6DF9A0:6A519A61 |
| html-safe-nonce | 19df7640a9b8741a32a87b8accc719b3a8957511112c1c5d065ce40fd1babeda |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODk2OkFDRTgzOjUyMTdGNTo2REY5QTA6NkE1MTlBNjEiLCJ2aXNpdG9yX2lkIjoiNTE1ODE0ODI4NTY3MjgyMzM5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 69d257ed6faa2c74626566fd1f344d7c2455ad7519663e92fa7c4d07370bf5af |
| hovercard-subject-tag | issue:1909969713 |
| 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/26901/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6f54a3447e9f7c3711eb7cb8ce0fe966d132bc5be240d077c09fca5ebf02ab14/matplotlib/matplotlib/issues/26901 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6f54a3447e9f7c3711eb7cb8ce0fe966d132bc5be240d077c09fca5ebf02ab14/matplotlib/matplotlib/issues/26901 |
| og:image:alt | Problem A busy icon appears every time the mouse goes off the axes and the cursor is cleared. For image files ~100MB, the busy icon lasts 1-2 seconds each time. Sample code: from matplotlib.widgets... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | komoto48g |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width