Title: Support for Scalar Image Cursor Display? · Issue #3984 · matplotlib/matplotlib · GitHub
Open Graph Title: Support for Scalar Image Cursor Display? · Issue #3984 · matplotlib/matplotlib
X Title: Support for Scalar Image Cursor Display? · Issue #3984 · matplotlib/matplotlib
Description: How would everyone feel about the following change? It will show the z value of a scalar image in the cursor if available (similar to what Matlab does). If there is no image or the image is RGB, it will revert to the previous behaviour. ...
Open Graph Description: How would everyone feel about the following change? It will show the z value of a scalar image in the cursor if available (similar to what Matlab does). If there is no image or the image is RGB, it...
X Description: How would everyone feel about the following change? It will show the z value of a scalar image in the cursor if available (similar to what Matlab does). If there is no image or the image is RGB, it...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3984
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support for Scalar Image Cursor Display?","articleBody":"How would everyone feel about the following change? It will show the `z` value of a scalar image in the cursor if available (similar to what Matlab does). If there is no image or the image is RGB, it will revert to the previous behaviour.\n\n``` diff\n--- a/lib/matplotlib/axes/_base.py\n+++ b/lib/matplotlib/axes/_base.py\n@@ -2971,7 +2971,12 @@ class _AxesBase(martist.Artist):\n ys = '???'\n else:\n ys = self.format_ydata(y)\n- return 'x=%s y=%s' % (xs, ys)\n+ try:\n+ z = self.images[0].get_array()[int(y + 0.5), int(x + 0.5)]\n+ zs = self.format_xdata(z)\n+ return 'x=%s y=%s z=%s' % (xs, ys, zs)\n+ except:\n+ return 'x=%s y=%s' % (xs, ys)\n\n def minorticks_on(self):\n 'Add autoscaling minor ticks to the axes.'\n```\n","author":{"url":"https://github.com/blink1073","@type":"Person","name":"blink1073"},"datePublished":"2015-01-09T02:27:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":27},"url":"https://github.com/3984/matplotlib/issues/3984"}
| 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:8aa90bee-25a1-9855-5471-089999281ac1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB9E:191073:C2EFB0:104440E:6A52A199 |
| html-safe-nonce | d048daa2a48c163912be1c9536b44efab720ea74e3c818677bc2b7e4b96f6709 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjlFOjE5MTA3MzpDMkVGQjA6MTA0NDQwRTo2QTUyQTE5OSIsInZpc2l0b3JfaWQiOiI3MDQ1NjU5ODczOTM4NDE2MDI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1ad840e1817e350f47f90202f7f1f79bfcbac81f4d822691d2e7f7a61d8eb775 |
| hovercard-subject-tag | issue:53827108 |
| 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/3984/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0a067d7765dc297691c0ae5249ab5248d73c6affabdfd345f180c49a01b6a40e/matplotlib/matplotlib/issues/3984 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0a067d7765dc297691c0ae5249ab5248d73c6affabdfd345f180c49a01b6a40e/matplotlib/matplotlib/issues/3984 |
| og:image:alt | How would everyone feel about the following change? It will show the z value of a scalar image in the cursor if available (similar to what Matlab does). If there is no image or the image is RGB, it... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | blink1073 |
| 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