{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3984","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3984/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3984/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3984/events","html_url":"https://github.com/matplotlib/matplotlib/issues/3984","id":53827108,"number":3984,"title":"Support for Scalar Image Cursor Display?","user":{"login":"blink1073","id":2096628,"avatar_url":"https://avatars.githubusercontent.com/u/2096628?v=3","gravatar_id":"","url":"https://api.github.com/users/blink1073","html_url":"https://github.com/blink1073","followers_url":"https://api.github.com/users/blink1073/followers","following_url":"https://api.github.com/users/blink1073/following{/other_user}","gists_url":"https://api.github.com/users/blink1073/gists{/gist_id}","starred_url":"https://api.github.com/users/blink1073/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink1073/subscriptions","organizations_url":"https://api.github.com/users/blink1073/orgs","repos_url":"https://api.github.com/users/blink1073/repos","events_url":"https://api.github.com/users/blink1073/events{/privacy}","received_events_url":"https://api.github.com/users/blink1073/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-01-09T02:27:34Z","updated_at":"2015-01-09T03:50:26Z","closed_at":null,"body":"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.\r\n\r\n```diff\r\n--- a/lib/matplotlib/axes/_base.py\r\n+++ b/lib/matplotlib/axes/_base.py\r\n@@ -2971,7 +2971,12 @@ class _AxesBase(martist.Artist):\r\n             ys = '???'\r\n         else:\r\n             ys = self.format_ydata(y)\r\n-        return 'x=%s y=%s' % (xs, ys)\r\n+        try:\r\n+            z = self.images[0].get_array()[int(y + 0.5), int(x + 0.5)]\r\n+            zs = self.format_xdata(z)\r\n+            return 'x=%s y=%s z=%s' % (xs, ys, zs)\r\n+        except:\r\n+            return 'x=%s y=%s' % (xs, ys)\r\n \r\n     def minorticks_on(self):\r\n         'Add autoscaling minor ticks to the axes.'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/69289845","html_url":"https://github.com/matplotlib/matplotlib/issues/3984#issuecomment-69289845","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3984","id":69289845,"user":{"login":"WeatherGod","id":291576,"avatar_url":"https://avatars.githubusercontent.com/u/291576?v=3","gravatar_id":"","url":"https://api.github.com/users/WeatherGod","html_url":"https://github.com/WeatherGod","followers_url":"https://api.github.com/users/WeatherGod/followers","following_url":"https://api.github.com/users/WeatherGod/following{/other_user}","gists_url":"https://api.github.com/users/WeatherGod/gists{/gist_id}","starred_url":"https://api.github.com/users/WeatherGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeatherGod/subscriptions","organizations_url":"https://api.github.com/users/WeatherGod/orgs","repos_url":"https://api.github.com/users/WeatherGod/repos","events_url":"https://api.github.com/users/WeatherGod/events{/privacy}","received_events_url":"https://api.github.com/users/WeatherGod/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T03:50:26Z","updated_at":"2015-01-09T03:50:26Z","body":"You guys are just trying to obsolete my book before it comes out, aren't\r\nyou? Can't you wait until the 2nd edition? ;-)\r\nOn Jan 8, 2015 10:43 PM, \"Steven Silvester\" <notifications@github.com>\r\nwrote:\r\n\r\n> @tacaswell <https://github.com/tacaswell>, what zdata would you want\r\n> about other artist types? The size of an element?\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/matplotlib/matplotlib/issues/3984#issuecomment-69289439>\r\n> .\r\n>"}}