Title: Continued Text Alignment Issues · Issue #1742 · matplotlib/matplotlib · GitHub
Open Graph Title: Continued Text Alignment Issues · Issue #1742 · matplotlib/matplotlib
X Title: Continued Text Alignment Issues · Issue #1742 · matplotlib/matplotlib
Description: When using AnchoredText, setting the horizontal alignment to 'center' causes the text to be centered around the left-most edge of the text space. In other words, the text is being centered around the location of the the left spine of the...
Open Graph Description: When using AnchoredText, setting the horizontal alignment to 'center' causes the text to be centered around the left-most edge of the text space. In other words, the text is being centered around t...
X Description: When using AnchoredText, setting the horizontal alignment to 'center' causes the text to be centered around the left-most edge of the text space. In other words, the text is being centered ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/1742
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Continued Text Alignment Issues","articleBody":"When using AnchoredText, setting the horizontal alignment to 'center' causes the text to be centered around the left-most edge of the text space. In other words, the text is being centered around the location of the the left spine of the text box plus the padding amount.\n\nIf you try to right-align the text, the entire text is actually found to the left of the text box.\n\nHere's a simple example and figure to illustrate. Note, this works with or without ImageGrid.\n\n```\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import ImageGrid\nfrom mpl_toolkits.axes_grid.anchored_artists import AnchoredText\nfig = plt.figure()\n# grid = ImageGrid(fig, 111, nrows_ncols=(1,1))\n# ax0 = grid[0]\nax0 = fig.add_subplot(111)\ntitle = 'Test Test Test Test Test'\nat = AnchoredText(title, prop=dict(size=24, horizontalalignment='center'),\n frameon=True, loc=9, borderpad=0.5, pad=0.5)\nat.patch.set_boxstyle(\"round, pad=0, rounding_size=0.25\")\nax0.add_artist(at)\nplt.show()\n```\n\n\n\nHere are a couple of issues and pull requests that _could_ be related.\n\nIssue #1571 \nPull Request #1081 \nPull Request #1589\n","author":{"url":"https://github.com/pmarshwx","@type":"Person","name":"pmarshwx"},"datePublished":"2013-02-09T20:53:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/1742/matplotlib/issues/1742"}
| 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:383b4dc0-a9b1-ccbf-cde4-a5984c78dd1a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A896:10C4A4:AD80C5:E8800B:6A529BB5 |
| html-safe-nonce | 5d274bd0ae438dd3e9a7e0dd3efdd142800037042f74531ec21b230f6b8f8be3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODk2OjEwQzRBNDpBRDgwQzU6RTg4MDBCOjZBNTI5QkI1IiwidmlzaXRvcl9pZCI6IjE2MDczNjMxNTY5Mzc3MTA1MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 83e0e76b2d3014f0ae09f9ec49992ed6db337e4099ebcea1b41d629337c24a42 |
| hovercard-subject-tag | issue:10814253 |
| 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/1742/issue_layout |
| twitter:image | https://opengraph.githubassets.com/69abb014d69256e85550b1310514d88eea26139809a2af0328b7eaec15209a9f/matplotlib/matplotlib/issues/1742 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/69abb014d69256e85550b1310514d88eea26139809a2af0328b7eaec15209a9f/matplotlib/matplotlib/issues/1742 |
| og:image:alt | When using AnchoredText, setting the horizontal alignment to 'center' causes the text to be centered around the left-most edge of the text space. In other words, the text is being centered around t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pmarshwx |
| 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