Title: [Bug]: offset in transformed ellipse vertices · Issue #30165 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: offset in transformed ellipse vertices · Issue #30165 · matplotlib/matplotlib
X Title: [Bug]: offset in transformed ellipse vertices · Issue #30165 · matplotlib/matplotlib
Description: Bug summary I was following thissexample on drawing ellipses and wanted to get the vertices out. Calling Ellipse.get_vertices() returns the untransformed vertices which may be intended behaviour, but I also seem to be unable to produce t...
Open Graph Description: Bug summary I was following thissexample on drawing ellipses and wanted to get the vertices out. Calling Ellipse.get_vertices() returns the untransformed vertices which may be intended behaviour, b...
X Description: Bug summary I was following thissexample on drawing ellipses and wanted to get the vertices out. Calling Ellipse.get_vertices() returns the untransformed vertices which may be intended behaviour, b...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/30165
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: offset in transformed ellipse vertices","articleBody":"### Bug summary\n\nI was following [this](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html)sexample on drawing ellipses and wanted to get the vertices out. Calling Ellipse.get_vertices() returns the untransformed vertices which may be intended behaviour, but I also seem to be unable to produce the correct vertices under the transform and they seem to be off by a scale factor. Not entirely sure if it's a bug or something I don't understand.\n\nThe following code is a MWE trimmed down from the linked example\n\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Ellipse\nimport matplotlib.transforms as transforms\n\nfig, ax = plt.subplots(figsize=(6, 6))\n\nellipse = Ellipse((0, 0), width=1.15*2, height=2*0.823)\ntransf = transforms.Affine2D() \\\n .rotate_deg(45) \\\n .scale(2.54, 1.94) \\\n .translate(3.64, 4.0)\nellipse.set_transform(transf + ax.transData)\nax.add_patch(ellipse)\n\nvertices = ellipse.get_vertices()\ntransformed_vertices = ellipse.get_transform().transform(vertices)\ndata_verts = ax.transData.inverted().transform(transformed_vertices)\n\nax.plot([vertices[0][0],vertices[1][0]],[vertices[0][1],vertices[1][1]],c='green')\nax.plot([data_verts[0][0],data_verts[1][0]],[data_verts[0][1],data_verts[1][1]],c='red')\n\nplt.savefig('ellipse_test.png')\nplt.show()\n```\n\n### Actual outcome\n\n\n\n### Expected outcome\n\nThe red line to have endpoints associated with the vertices of the ellipse\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nUbuntu\n\n### Matplotlib Version\n\n3.10.3\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\nNone","author":{"url":"https://github.com/calebmiller","@type":"Person","name":"calebmiller"},"datePublished":"2025-06-11T14:03:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/30165/matplotlib/issues/30165"}
| 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:b4a7d344-a3f3-18f1-1077-bd007b3ce8a5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC9E:19F60D:165501D:1D7A9EB:6A51C400 |
| html-safe-nonce | 0920f846f25e64002a42158661554dd6c0aecc66d2b2c0e0ce6d5e0baad2adf4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzlFOjE5RjYwRDoxNjU1MDFEOjFEN0E5RUI6NkE1MUM0MDAiLCJ2aXNpdG9yX2lkIjoiMjUyNTE3MzAwNjM5MDY0MTY2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9e0f30513013b85f6a641a21a745aee3f15291e42f308c038afe6d726b6fb190 |
| hovercard-subject-tag | issue:3136965724 |
| 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/30165/issue_layout |
| twitter:image | https://opengraph.githubassets.com/54108127d7acc497586ee26be6bfc6acb82df90bd154c5a35615051f20cb4718/matplotlib/matplotlib/issues/30165 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/54108127d7acc497586ee26be6bfc6acb82df90bd154c5a35615051f20cb4718/matplotlib/matplotlib/issues/30165 |
| og:image:alt | Bug summary I was following thissexample on drawing ellipses and wanted to get the vertices out. Calling Ellipse.get_vertices() returns the untransformed vertices which may be intended behaviour, b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | calebmiller |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width