{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/8133","labels_url":"https://api.github.com/repos/ipython/ipython/issues/8133/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/8133/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/8133/events","html_url":"https://github.com/ipython/ipython/issues/8133","id":64073935,"number":8133,"title":"Intermittent SVG error in the notebook","user":{"login":"moble","id":1470769,"avatar_url":"https://avatars.githubusercontent.com/u/1470769?v=3","gravatar_id":"","url":"https://api.github.com/users/moble","html_url":"https://github.com/moble","followers_url":"https://api.github.com/users/moble/followers","following_url":"https://api.github.com/users/moble/following{/other_user}","gists_url":"https://api.github.com/users/moble/gists{/gist_id}","starred_url":"https://api.github.com/users/moble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moble/subscriptions","organizations_url":"https://api.github.com/users/moble/orgs","repos_url":"https://api.github.com/users/moble/repos","events_url":"https://api.github.com/users/moble/events{/privacy}","received_events_url":"https://api.github.com/users/moble/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-03-24T19:01:52Z","updated_at":"2015-03-25T19:58:39Z","closed_at":null,"body":"I have long had a problem with SVG matplotlib output in the notebook.  Intermittently, the plot will extend outside of the axes, as exemplified in this screenshot:\r\n\r\n![matplotlibsvgnotebookbug](https://cloud.githubusercontent.com/assets/1470769/6809961/3810d518-d234-11e4-8348-d49290f2e3d9.png)\r\n\r\nBasically, everything below the horizontal axis should be hidden.  Most of the time, it is properly hidden -- e.g., when the plot is first made, or when I collapse and expand the output area.  But then sometimes, it'll go buggy like this.  I can't reproduce this consistently, but it seems to happen most often when I make a plot in another cell.\r\n\r\nThat stuff that's usually hidden evidently does correspond to actual data; when I plot again with `xlim(xmin=1e-18)`, the data does show up just like that, except that it is correctly based at 1e-18.  So it's evidently really in the SVG.\r\n\r\nI'm wondering if this is related to #1881 and #2647, but none of the descriptions of problems there were specific enough.  Is this expected badness in the matplotlib output?\r\n\r\nI've had this problem for a long time (years?), but I can verify that it exists currently in IPython 3.0.0.  I'm seeing it in up-to-date Chrome and Safari on up-to-date OS X, using an up-to-date anaconda installation (python 2.7).  Here are the IPython details:\r\n\r\n{'commit_hash': u'f75fda4',\r\n 'commit_source': 'installation',\r\n 'default_encoding': 'UTF-8',\r\n 'ipython_path': ..../anaconda/lib/python2.7/site-packages/IPython',\r\n 'ipython_version': '3.0.0',\r\n 'os_name': 'posix',\r\n 'platform': 'Darwin-14.1.0-x86_64-i386-64bit',\r\n 'sys_executable': '/Users/boyle/.continuum/anaconda/bin/python',\r\n 'sys_platform': 'darwin',\r\n 'sys_version': '2.7.9 |Continuum Analytics, Inc.| (default, Dec 15 2014, 10:37:34) \\n[GCC 4.2.1 (Apple Inc. build 5577)]'}"},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/86194668","html_url":"https://github.com/ipython/ipython/issues/8133#issuecomment-86194668","issue_url":"https://api.github.com/repos/ipython/ipython/issues/8133","id":86194668,"user":{"login":"rsmith31415","id":599274,"avatar_url":"https://avatars.githubusercontent.com/u/599274?v=3","gravatar_id":"","url":"https://api.github.com/users/rsmith31415","html_url":"https://github.com/rsmith31415","followers_url":"https://api.github.com/users/rsmith31415/followers","following_url":"https://api.github.com/users/rsmith31415/following{/other_user}","gists_url":"https://api.github.com/users/rsmith31415/gists{/gist_id}","starred_url":"https://api.github.com/users/rsmith31415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsmith31415/subscriptions","organizations_url":"https://api.github.com/users/rsmith31415/orgs","repos_url":"https://api.github.com/users/rsmith31415/repos","events_url":"https://api.github.com/users/rsmith31415/events{/privacy}","received_events_url":"https://api.github.com/users/rsmith31415/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T19:58:39Z","updated_at":"2015-03-25T19:58:39Z","body":"@moble You're quite right. I found something interesting using this minimal example:\r\n\r\n    plt.plot([0.5], [0.5], 'bo')\r\n    plt.xlim(0, 0.5)\r\n\r\nI copied twice the SVG code:\r\n\r\n![screenshot from 2015-03-25 13 52 37](https://cloud.githubusercontent.com/assets/599274/6833947/3e95d272-d2f6-11e4-8930-afd68a148d35.png)\r\n\r\nbut now, I deleted the first node `<def>`:\r\n\r\n    <defs>\r\n      <style type=\"text/css\">\r\n     *{stroke-linecap:butt;stroke-linejoin:round;}\r\n      </style>\r\n    </defs>\r\n\r\nin both SVGs. Then I delete the first SVG. The resulting image is finally correct:\r\n\r\n![screenshot from 2015-03-25 13 55 54](https://cloud.githubusercontent.com/assets/599274/6834020/b533bf66-d2f6-11e4-8fae-f070eaf53b9f.png)\r\n\r\nIf I delete, for example, the last `<def>` or a path, the bug persists:\r\n\r\n![screenshot from 2015-03-25 13 57 45](https://cloud.githubusercontent.com/assets/599274/6834051/f1fa74bc-d2f6-11e4-800c-9831813b54a9.png)\r\n\r\n"}}