René's URL Explorer Experiment


Title: Test layout with big descenders and multiple lines inconsistent. · Issue #11498 · matplotlib/matplotlib · GitHub

Open Graph Title: Test layout with big descenders and multiple lines inconsistent. · Issue #11498 · matplotlib/matplotlib

X Title: Test layout with big descenders and multiple lines inconsistent. · Issue #11498 · matplotlib/matplotlib

Description: Bug report Follow up #11468 If we have multiline text with big descenders (i.e. $\sum_i x$) then the layout mechanism in Text._get_layout() doesn't handle the big descenders properly. Note that _get_layout() gives us the bounding box for...

Open Graph Description: Bug report Follow up #11468 If we have multiline text with big descenders (i.e. $\sum_i x$) then the layout mechanism in Text._get_layout() doesn't handle the big descenders properly. Note that _ge...

X Description: Bug report Follow up #11468 If we have multiline text with big descenders (i.e. $\sum_i x$) then the layout mechanism in Text._get_layout() doesn't handle the big descenders properly. Note that...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11498

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test layout with big descenders and multiple lines inconsistent.","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\nFollow up #11468 \r\n\r\nIf we have multiline text with big descenders (i.e. `$\\sum_i x$`) then the layout mechanism in `Text._get_layout()` doesn't handle the big descenders properly.  Note that `_get_layout()` gives us the bounding box for `text.get_window_extent` so this causes problems for anything that needs to know where the text is and what its size is.  \r\n\r\n1. The layout is fine for single lines even large descenders. (first three text objects on each line)\r\n2. For two lines with the same descend the layout is fine (last text object on each line)\r\n3. For mixed size descenders (`test` and ` $\\sum_i x$`) the layout is erroneous.  If the big descender comes first, the layout box is too big; conversely if it comes second.  \r\n\r\nI keep chasing around solutions, but the algorithm is a bit idiosyncratic so thought I'd post here if anyone had institutional knowledge.  \r\n\r\n![old](https://user-images.githubusercontent.com/1562854/41821391-b1c7fc20-7794-11e8-9827-d390579796c7.png)\r\n\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.patches as mpatches\r\n\r\nfig, ax = plt.subplots(constrained_layout=False)\r\n\r\nax.set_xlim([0, 1.4])\r\nax.set_ylim([0, 2])\r\nax.axhline(0.5, color='C2', linewidth=0.3)\r\nsts = ['Line', '2 Lines g\\n 2nd Line g', '$\\sum_i x $', 'hi $\\sum_i x $\\ntest', 'test\\n $\\sum_i x $', '$\\sum_i x $\\n $\\sum_i x $']\r\n\r\nfor nn, st in enumerate(sts):\r\n    tt = ax.text(0.2 * nn + 0.1, 0.5, st, horizontalalignment='center',\r\n        verticalalignment='bottom')\r\n    bb = tt.get_window_extent(fig.canvas.get_renderer())\r\n    bbt = bb.inverse_transformed(ax.transAxes)\r\n    r = mpatches.Rectangle((0,0), 1, 1, clip_on=False, transform=ax.transAxes)\r\n    r.set_bounds(bbt.bounds)\r\n    ax.add_patch(r)\r\nax.text(1.2, 0.5, 'Bottom align', color='C2')\r\n\r\n\r\nif 1:\r\n\r\n    ax.axhline(1.3, color='C2', linewidth=0.3)\r\n    for nn, st in enumerate(sts):\r\n        tt = ax.text(0.2 * nn + 0.1, 1.3, st, horizontalalignment='center',\r\n            verticalalignment='top')\r\n        bb = tt.get_window_extent(fig.canvas.get_renderer())\r\n        bbt = bb.inverse_transformed(ax.transAxes)\r\n        r = mpatches.Rectangle((0,0), 1, 1, clip_on=False, transform=ax.transAxes)\r\n        r.set_bounds(bbt.bounds)\r\n        ax.add_patch(r)\r\n    ax.text(1.2, 1.3, 'Top align', color='C2')\r\n\r\n\r\n    ax.axhline(1.8, color='C2', linewidth=0.3)\r\n    for nn, st in enumerate(sts):\r\n        tt = ax.text(0.2 * nn + 0.1, 1.8, st, horizontalalignment='center',\r\n            verticalalignment='baseline')\r\n        bb = tt.get_window_extent(fig.canvas.get_renderer())\r\n        bbt = bb.inverse_transformed(ax.transAxes)\r\n        r = mpatches.Rectangle((0,0), 1, 1, clip_on=False, transform=ax.transAxes)\r\n        r.set_bounds(bbt.bounds)\r\n        ax.add_patch(r)\r\n    ax.text(1.2, 1.8, 'Baseline align', color='C2')\r\n\r\n\r\n    ax.axhline(0.1, color='C2', linewidth=0.3)\r\n\r\n    for nn, st in enumerate(sts):\r\n        tt = ax.text(0.2 * nn + 0.1, 0.1, st, horizontalalignment='center',\r\n            verticalalignment='bottom', rotation=20)\r\n        bb = tt.get_window_extent(fig.canvas.get_renderer())\r\n        bbt = bb.inverse_transformed(ax.transAxes)\r\n        r = mpatches.Rectangle((0,0), 1, 1, clip_on=False, transform=ax.transAxes)\r\n        r.set_bounds(bbt.bounds)\r\n        ax.add_patch(r)\r\n    ax.text(1.2, 0.1, 'Bot align, rot20', color='C2')\r\n\r\n\r\nbb = tt.get_window_extent(fig.canvas.get_renderer())\r\nbbt = bb.inverse_transformed(ax.transAxes)\r\nr = mpatches.Rectangle((0,0), 1, 1, clip_on=False, transform=ax.transAxes)\r\nr.set_bounds(bbt.bounds)\r\nax.add_patch(r)\r\n\r\nfig.savefig('Old.png')\r\n\r\nplt.show()\r\n```\r\n","author":{"url":"https://github.com/jklymak","@type":"Person","name":"jklymak"},"datePublished":"2018-06-24T17:04:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/11498/matplotlib/issues/11498"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b840155d-8d8a-67ad-de77-4ee24dcd9ef2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9018:1C1C74:52CA10:6EE8AC:6A5596B0
html-safe-nonce7bf9ac492f8492640ba1268837f63de6ebe440c5f28893d978f3a067d9204554
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDE4OjFDMUM3NDo1MkNBMTA6NkVFOEFDOjZBNTU5NkIwIiwidmlzaXRvcl9pZCI6IjIwNTYxNjI5NTEzMjk4NDY5NjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac06cd3be724bdcecf4ca58a9cdf75674bdfcc06b4fa3d2389228a248b1527301a
hovercard-subject-tagissue:335195203
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/11498/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bc82432f855c6dc079c1ac43faa9a98d55ab19f1164c933ca5f57ef1602f57bf/matplotlib/matplotlib/issues/11498
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bc82432f855c6dc079c1ac43faa9a98d55ab19f1164c933ca5f57ef1602f57bf/matplotlib/matplotlib/issues/11498
og:image:altBug report Follow up #11468 If we have multiline text with big descenders (i.e. $\sum_i x$) then the layout mechanism in Text._get_layout() doesn't handle the big descenders properly. Note that _ge...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejklymak
hostnamegithub.com
expected-hostnamegithub.com
Noneb5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseaa21baa44893467b0b640d0300538f84ca8c475b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/11498#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F11498
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F11498
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/11498
Reloadhttps://github.com/matplotlib/matplotlib/issues/11498
Reloadhttps://github.com/matplotlib/matplotlib/issues/11498
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/11498
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/11498
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 409 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
#11499https://github.com/matplotlib/matplotlib/pull/11499
Test layout with big descenders and multiple lines inconsistent.https://github.com/matplotlib/matplotlib/issues/11498#top
#11499https://github.com/matplotlib/matplotlib/pull/11499
v3.1.0https://github.com/matplotlib/matplotlib/milestone/35
https://github.com/jklymak
jklymakhttps://github.com/jklymak
on Jun 24, 2018https://github.com/matplotlib/matplotlib/issues/11498#issue-335195203
#11468https://github.com/matplotlib/matplotlib/issues/11468
https://user-images.githubusercontent.com/1562854/41821391-b1c7fc20-7794-11e8-9827-d390579796c7.png
v3.1.0https://github.com/matplotlib/matplotlib/milestone/35
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.