Title: Layout managers have problems with titles containing MathText · Issue #11468 · matplotlib/matplotlib · GitHub
Open Graph Title: Layout managers have problems with titles containing MathText · Issue #11468 · matplotlib/matplotlib
X Title: Layout managers have problems with titles containing MathText · Issue #11468 · matplotlib/matplotlib
Description: Layout managers seem to have problems with titles containing MathText. One would expect to have a title which neither overlaps with the axes nor with the figure boundary in all cases depicted below. tight_layout multi line title as expec...
Open Graph Description: Layout managers seem to have problems with titles containing MathText. One would expect to have a title which neither overlaps with the axes nor with the figure boundary in all cases depicted below...
X Description: Layout managers seem to have problems with titles containing MathText. One would expect to have a title which neither overlaps with the axes nor with the figure boundary in all cases depicted below...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11468
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Layout managers have problems with titles containing MathText","articleBody":"Layout managers seem to have problems with titles containing MathText.\r\n\r\nOne would expect to have a title which neither overlaps with the axes nor with the figure boundary in all cases depicted below.\r\n\r\n## tight_layout\r\n\r\n### multi line title\r\n\r\n\r\n\r\nas expected\r\n\r\n### multi line title with MathText\r\n\r\n\r\n\r\n\r\nThe title is a bit squeezed towards the top figure boundary, but does not go beyond it, nor does it overlap the axes. This is somehow still acceptable.\r\n\r\n\r\n### single line title with MathText\r\n\r\n\r\n\r\nHere the title overlaps with the axes. This is in thus far strange because in the case above with multiple lines, this overlap does not occur.\r\n\r\n\r\n## constrained_layout\r\n\r\n### multi line title\r\n\r\n\r\n\r\nas expected\r\n\r\n### multi line title with MathText\r\n\r\n\r\n\r\nThe title exits the figure. This is not desiredeable.\r\n\r\n\r\n### single line title with MathText\r\n\r\n\r\n\r\nHere the title overlaps with the axes. \r\n\r\n## code \r\n\r\n```\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\nplt.rcParams['savefig.facecolor']='#e9f7fd'\r\n\r\ndef create_bug(title=\"\", constrained_layout=True, i=0):\r\n plt.figure(constrained_layout=constrained_layout)\r\n plt.plot([0,1,2],[0,1,1])\r\n plt.title(title)\r\n \r\n if not constrained_layout:\r\n plt.tight_layout()\r\n tx = \"tight_layout\"\r\n else:\r\n tx = \"constrained_layout\"\r\n plt.text(0.4,.95, tx, va=\"center\")\r\n plt.savefig(tx+str(i)+\".png\")\r\n \r\ntitles = ['line $\\sum_{i} x_i$',\r\n 'multi-\\nline $\\sum_{i} x_i$',\r\n 'multi-\\nline']\r\nfor layout in [True, False]:\r\n for i, title in enumerate(titles):\r\n create_bug(title, layout, i)\r\n```\r\n\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Windows 8.1\r\n * Matplotlib version: 2.2.2, current master\r\n * Matplotlib backend : Qt5Agg\r\n * Python version: 2.7, 3.6\r\n","author":{"url":"https://github.com/ImportanceOfBeingErnest","@type":"Person","name":"ImportanceOfBeingErnest"},"datePublished":"2018-06-20T23:44:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/11468/matplotlib/issues/11468"}
| 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:56af4ee6-1411-23d3-1b54-cd3b2a3050ed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D496:6FC4C:137D07:1A7F85:6A5467DC |
| html-safe-nonce | ef36f5d569bddd730d5065657b6d8cf4838d173753ec7eee87a2ef9bf3ea05d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDk2OjZGQzRDOjEzN0QwNzoxQTdGODU6NkE1NDY3REMiLCJ2aXNpdG9yX2lkIjoiOTgyNTQ3NDMzNzI4MDEwMjA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f0c63878831083fb9d2c36c1ba8a3712c0acf06f37ff2d997b34805981da88af |
| hovercard-subject-tag | issue:334286961 |
| 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/11468/issue_layout |
| twitter:image | https://opengraph.githubassets.com/96ed1fd8f82ed42a9048c35517b34f3720b2a8c42d55b4289a83b9e2c80e8337/matplotlib/matplotlib/issues/11468 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/96ed1fd8f82ed42a9048c35517b34f3720b2a8c42d55b4289a83b9e2c80e8337/matplotlib/matplotlib/issues/11468 |
| og:image:alt | Layout managers seem to have problems with titles containing MathText. One would expect to have a title which neither overlaps with the axes nor with the figure boundary in all cases depicted below... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ImportanceOfBeingErnest |
| 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 | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width