{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4970","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4970/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4970/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4970/events","html_url":"https://github.com/matplotlib/matplotlib/pull/4970","id":102064002,"number":4970,"title":"Fixed ZoomPanBase to work with log plots","user":{"login":"ordirules","id":705366,"avatar_url":"https://avatars.githubusercontent.com/u/705366?v=3","gravatar_id":"","url":"https://api.github.com/users/ordirules","html_url":"https://github.com/ordirules","followers_url":"https://api.github.com/users/ordirules/followers","following_url":"https://api.github.com/users/ordirules/following{/other_user}","gists_url":"https://api.github.com/users/ordirules/gists{/gist_id}","starred_url":"https://api.github.com/users/ordirules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordirules/subscriptions","organizations_url":"https://api.github.com/users/ordirules/orgs","repos_url":"https://api.github.com/users/ordirules/repos","events_url":"https://api.github.com/users/ordirules/events{/privacy}","received_events_url":"https://api.github.com/users/ordirules/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_review","name":"needs_review","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"fariza","id":1490153,"avatar_url":"https://avatars.githubusercontent.com/u/1490153?v=3","gravatar_id":"","url":"https://api.github.com/users/fariza","html_url":"https://github.com/fariza","followers_url":"https://api.github.com/users/fariza/followers","following_url":"https://api.github.com/users/fariza/following{/other_user}","gists_url":"https://api.github.com/users/fariza/gists{/gist_id}","starred_url":"https://api.github.com/users/fariza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fariza/subscriptions","organizations_url":"https://api.github.com/users/fariza/orgs","repos_url":"https://api.github.com/users/fariza/repos","events_url":"https://api.github.com/users/fariza/events{/privacy}","received_events_url":"https://api.github.com/users/fariza/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12","html_url":"https://github.com/matplotlib/matplotlib/milestones/proposed%20next%20point%20release%20(2.1)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12/labels","id":534144,"number":12,"title":"proposed next point release (2.1)","description":"Next feature release.\r\n\r\nBig ticket items:\r\n\r\n - MEP 22/27\r\n - traitlets","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":409,"closed_issues":238,"state":"open","created_at":"2014-01-13T03:21:09Z","updated_at":"2015-09-27T03:07:20Z","due_on":null,"closed_at":null},"comments":41,"created_at":"2015-08-20T05:12:15Z","updated_at":"2015-09-30T04:05:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4970","html_url":"https://github.com/matplotlib/matplotlib/pull/4970","diff_url":"https://github.com/matplotlib/matplotlib/pull/4970.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/4970.patch"},"body":"Tested this code in a matplotlib 1.4.3 environment and current branch. Fixed ZoomPanBase to work in non-linear plots by changing the scale in the axes coordinates and using the respective tranformation functions: transScale and transLimits transforms. \r\n\r\nSee tutorial on axes transformations for more details:\r\nhttp://matplotlib.org/users/transforms_tutorial.html\r\n\r\nNote: It did not work in my version 1.4.2. The issue is traceable to the TransScale.transform.inverted() routine expecting a 2 dimensional array rather than 1d array. If applying this to this older version this should be investigated/tested.\r\n\r\nTesting code used (use mouse scroll wheel afterwards):\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.backend_tools as bt\r\nimport numpy as np\r\n\r\nfig1 = plt.figure(0)\r\nzm = bt.ZoomPanBase(fig1,\"foo\")\r\n\r\n\r\nimg = np.random.random((100,100))\r\nax = fig1.add_subplot(111)\r\n\r\nx = np.linspace(10,1000,1000)\r\ny = 1/x**4\r\n\r\n#uncomment the one you want to test, and comment the other\r\n#ax.imshow(img)\r\nax.loglog(x,y)\r\n\r\ndef foofunc():\r\n    pass\r\n\r\nzm._press = foofunc\r\nzm._release = foofunc\r\n\r\nzm.enable(\"foo\")\r\n```"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/144275868","html_url":"https://github.com/matplotlib/matplotlib/pull/4970#issuecomment-144275868","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4970","id":144275868,"user":{"login":"ordirules","id":705366,"avatar_url":"https://avatars.githubusercontent.com/u/705366?v=3","gravatar_id":"","url":"https://api.github.com/users/ordirules","html_url":"https://github.com/ordirules","followers_url":"https://api.github.com/users/ordirules/followers","following_url":"https://api.github.com/users/ordirules/following{/other_user}","gists_url":"https://api.github.com/users/ordirules/gists{/gist_id}","starred_url":"https://api.github.com/users/ordirules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordirules/subscriptions","organizations_url":"https://api.github.com/users/ordirules/orgs","repos_url":"https://api.github.com/users/ordirules/repos","events_url":"https://api.github.com/users/ordirules/events{/privacy}","received_events_url":"https://api.github.com/users/ordirules/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T04:05:16Z","updated_at":"2015-09-30T04:05:16Z","body":"@fariza - I want to wait for [the small view PR] (https://github.com/matplotlib/matplotlib/pull/5108) since it sort of overlaps. (sorry for the delay)\r\n\r\nIt might be good to also ignore the bbox completely and have the scroll zooming done in _set_view_from_bbox. The idea of the view as @QuLogic mentioned is to keep its handling inside the axes. The set_view_from_bbox routine in my opinion (correct me if I'm wrong) was written simply to allow the selection box tool to work. With that logic, we could tweak it to allow the zoom tool to work as well, rather than have a routine that returns a bounding box from the view, which as far as we know, could be gibberish depending on the axes.\r\n\r\n\r\n@OceanWolf thanks. I'm  a dummy, I should have thought of that... I think I am now mastering git, it's not bad once you finally get the hang of it. Will clean up the commits again after the PR mentioned gets resolved.\r\n\r\n"}}