{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/8507","labels_url":"https://api.github.com/repos/ipython/ipython/issues/8507/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/8507/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/8507/events","html_url":"https://github.com/ipython/ipython/issues/8507","id":85012074,"number":8507,"title":"Adding a matplotlib patch to inline axis twice in a notebook causes offset","user":{"login":"jdugge","id":2399255,"avatar_url":"https://avatars.githubusercontent.com/u/2399255?v=3","gravatar_id":"","url":"https://api.github.com/users/jdugge","html_url":"https://github.com/jdugge","followers_url":"https://api.github.com/users/jdugge/followers","following_url":"https://api.github.com/users/jdugge/following{/other_user}","gists_url":"https://api.github.com/users/jdugge/gists{/gist_id}","starred_url":"https://api.github.com/users/jdugge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdugge/subscriptions","organizations_url":"https://api.github.com/users/jdugge/orgs","repos_url":"https://api.github.com/users/jdugge/repos","events_url":"https://api.github.com/users/jdugge/events{/privacy}","received_events_url":"https://api.github.com/users/jdugge/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-04T09:50:29Z","updated_at":"2015-06-04T17:50:22Z","closed_at":"2015-06-04T17:35:34Z","body":"(I originally posted this as [a question on Stackoverflow](http://stackoverflow.com/questions/30639284/adding-a-matplotlib-patch-to-inline-axis-twice-in-an-ipython-notebook-causes-off))\r\n\r\nI have a matplotlib `patch` that I want to add to two different axis objects. Calling `ax1.add_patch(my_patch)` the first time leads to the correct result, but when I call `ax2.add_patch(my_patch)`, the patch is offset horizontally. Calling `add_patch` again after that does not change the offset.\r\n\r\nThis only seems to happen when using `%matplotlib inline`. Generating the figures in separate windows does not lead to the offset.\r\n\r\nMinimal example:\r\n\r\n    import numpy as np\r\n    from matplotlib.patches import Circle\r\n    import matplotlib.pyplot as plt\r\n\r\n    %matplotlib inline\r\n\r\n    grid = np.ones([10,10])\r\n    circle = Circle((5,5), 2)\r\n\r\n    fig1, ax1 = plt.subplots()\r\n    ax1.imshow(grid, interpolation='None')\r\n    ax1.add_patch(circle)\r\n\r\n    fig2, ax2 = plt.subplots()\r\n    ax2.imshow(grid, interpolation='None')\r\n    ax2.add_patch(circle)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/2399255/7981454/4428cde8-0aaf-11e5-84dd-a1ac1f3f3392.png)\r\n\r\n\r\n____\r\n\r\nSystem information:\r\n\r\n```\r\n'commit_hash': u'cbccb68',\r\n 'commit_source': 'installation',\r\n 'default_encoding': 'UTF-8',\r\n 'ipython_path': '/usr/local/lib/python2.7/dist-packages/IPython',\r\n 'ipython_version': '3.1.0',\r\n 'os_name': 'posix',\r\n 'platform': 'Linux-3.13.0-24-generic-x86_64-with-LinuxMint-17-qiana',\r\n 'sys_executable': '/usr/bin/python',\r\n 'sys_platform': 'linux2',\r\n 'sys_version': '2.7.6 (default, Mar 22 2014, 22:59:56) \\n[GCC 4.8.2]'\r\n```\r\n\r\n`'matplotlib.__version__': '1.4.3'`"},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/108990235","html_url":"https://github.com/ipython/ipython/issues/8507#issuecomment-108990235","issue_url":"https://api.github.com/repos/ipython/ipython/issues/8507","id":108990235,"user":{"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},"created_at":"2015-06-04T17:50:22Z","updated_at":"2015-06-04T17:50:22Z","body":"What @jenshnielsen said."}}