{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4160","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4160/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4160/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4160/events","html_url":"https://github.com/matplotlib/matplotlib/issues/4160","id":58886306,"number":4160,"title":"Bug when clearing axes created with twinx","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-25T11:17:49Z","updated_at":"2015-02-25T18:05:31Z","closed_at":"2015-02-25T16:54:52Z","body":"### Buggy case\r\n\r\nThe following example produces an empty figure:\r\n\r\n```\r\nimport matplotlib.pyplot as plt\r\n\r\nfig = plt.figure()\r\nax1 = fig.add_subplot(1,1,1)\r\nax2 = ax1.twinx()\r\nax2.cla()\r\nax1.plot([1,2,3])\r\nfig.savefig('test.png')\r\n```\r\n\r\n![test](https://cloud.githubusercontent.com/assets/314716/6369582/1084aecc-bce8-11e4-970a-a7e7750b8c74.png)\r\n\r\n### Control case\r\n\r\nIf I remove ``twinx`` it works:\r\n\r\n```\r\nimport matplotlib.pyplot as plt\r\n\r\nfig = plt.figure()\r\nax1 = fig.add_subplot(1,1,1)\r\nax2 = ax1.twinx()\r\nax1.plot([1,2,3])\r\nfig.savefig('test.png')\r\n```\r\n\r\n![test](https://cloud.githubusercontent.com/assets/314716/6369593/2d15caee-bce8-11e4-9a73-ef209384d12e.png)\r\n\r\n### Versions\r\n\r\n```\r\n$ python --version\r\nPython 3.4.2 :: Continuum Analytics, Inc.\r\n$ python -c 'import matplotlib; print(matplotlib.__version__)'\r\n1.4.2\r\n```"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/76019548","html_url":"https://github.com/matplotlib/matplotlib/issues/4160#issuecomment-76019548","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4160","id":76019548,"user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T18:05:31Z","updated_at":"2015-02-25T18:05:31Z","body":"@tacaswell - ah yes, it is indeed fixed now - sorry for the noise!"}}