Title: `savefig` messes up coordinate transformation of `annotate` · Issue #4375 · matplotlib/matplotlib · GitHub
Open Graph Title: `savefig` messes up coordinate transformation of `annotate` · Issue #4375 · matplotlib/matplotlib
X Title: `savefig` messes up coordinate transformation of `annotate` · Issue #4375 · matplotlib/matplotlib
Description: I want to annotate a data point with an inset axis (matplotlib-1.4.3, Linux): import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1.inset_locator import inset_axes x=np.linspace(0,10,200) y=np.exp(-x)*np.sin(x) ...
Open Graph Description: I want to annotate a data point with an inset axis (matplotlib-1.4.3, Linux): import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1.inset_locator import inset_axes x=np.li...
X Description: I want to annotate a data point with an inset axis (matplotlib-1.4.3, Linux): import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1.inset_locator import inset_axes x=np.li...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/4375
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`savefig` messes up coordinate transformation of `annotate`","articleBody":"I want to annotate a data point with an inset axis (matplotlib-1.4.3, Linux):\n\n```\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom mpl_toolkits.axes_grid1.inset_locator import inset_axes\n\nx=np.linspace(0,10,200)\ny=np.exp(-x)*np.sin(x)\n\nfig,ax = plt.subplots(figsize=(3.39,3))\n\nax.plot(x,y)\n\naxins=inset_axes(ax, width=0.6, height=0.6, bbox_to_anchor=(6, 0.2),bbox_transform=ax.transData)\naxins.axes.get_xaxis().set_visible(False)\naxins.axes.get_yaxis().set_visible(False)\nax.annotate(\"\",xy=(x[150],y[150]), xycoords=ax.transData,\n xytext=(1, 0), textcoords=axins.transAxes,\n arrowprops=dict(arrowstyle=\"-\u003e\"))\n\nfig.savefig('example.pdf')\nplt.show()\n```\n\nThis is the correct plot shown on screen:\n\nThis is what `savefig` produces:\n\n\nApparently `savefig` changes the coordinates `(1,0)` from the inset axes to the parent axes for some reason.\n","author":{"url":"https://github.com/PiQuer","@type":"Person","name":"PiQuer"},"datePublished":"2015-04-23T13:40:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/4375/matplotlib/issues/4375"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1b765c88-99d1-5752-b4a3-6a5f7f1b6b6f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93B0:2FB335:16FC13F:1EAA7E5:6A52BD42 |
| html-safe-nonce | 396d8a5c66bf408c29e1d00dcdb96c5768a4103680079bfc03ea90dd200a7b36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0IwOjJGQjMzNToxNkZDMTNGOjFFQUE3RTU6NkE1MkJENDIiLCJ2aXNpdG9yX2lkIjoiMTU2NTE1NDM0NDM2MTQ0MjYyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7d4337cbb96c263682f9cfdcc65a1d6b7563ac7e81d46769a995760a5b8316ac |
| hovercard-subject-tag | issue:70415142 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/4375/issue_layout |
| twitter:image | https://opengraph.githubassets.com/babafa6986a041d61cb8c364a2bcdffc502a6c342254b69f4d7bd4ad1905eec7/matplotlib/matplotlib/issues/4375 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/babafa6986a041d61cb8c364a2bcdffc502a6c342254b69f4d7bd4ad1905eec7/matplotlib/matplotlib/issues/4375 |
| og:image:alt | I want to annotate a data point with an inset axis (matplotlib-1.4.3, Linux): import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1.inset_locator import inset_axes x=np.li... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PiQuer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width