René's URL Explorer Experiment


Title: tight_layout reserves tick space even if disabled · Issue #11203 · matplotlib/matplotlib · GitHub

Open Graph Title: tight_layout reserves tick space even if disabled · Issue #11203 · matplotlib/matplotlib

X Title: tight_layout reserves tick space even if disabled · Issue #11203 · matplotlib/matplotlib

Description: Bug report tight_layout seems to reserve space for axes ticks even if they are removed I like to save a plot with zero surrounding whitespace. Previously (version 1.5.3) this was possible by setting bbox_inches='tight', pad_inches=0 in t...

Open Graph Description: Bug report tight_layout seems to reserve space for axes ticks even if they are removed I like to save a plot with zero surrounding whitespace. Previously (version 1.5.3) this was possible by settin...

X Description: Bug report tight_layout seems to reserve space for axes ticks even if they are removed I like to save a plot with zero surrounding whitespace. Previously (version 1.5.3) this was possible by settin...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tight_layout reserves tick space even if disabled","articleBody":"### Bug report\r\n\r\n**tight_layout seems to reserve space for axes ticks even if they are removed**\r\n\r\nI like to save a plot with zero surrounding whitespace. \r\n\r\nPreviously (version 1.5.3) this was possible by setting `bbox_inches='tight', pad_inches=0` in the `savefig` call and removing any axis decorators (ticks, labels). In the current version (version 2.2.2) the whitespace around the plot cannot be fully removed in the above way, even if decorators are removed. It seems that the remaining whitespace corresponds to the area that the axis ticks would be drawn in, had they not been removed.\r\n\r\nThis seems to be related to [recent changes](https://matplotlib.org/2.2.2/users/whats_new.html#axes-legends-now-included-in-tight-bbox) in how axes legends get drawn:\r\n```\r\nTools like fig.tight_layout() and fig.savefig(bbox_inches='tight') \r\nwould clip these legends. \r\nA change was made to include them in the tight calculations.\r\n```\r\n\r\nIt seems not possible to save a plot with no surrounding whitespace in the current version.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\n# axis ticks drawn\r\nf = plt.figure(figsize=(1,1))\r\nax = f.add_subplot(111)\r\nax.matshow(np.ones((10,10)), cmap=plt.cm.Blues_r, aspect='auto')\r\nax.set_xticklabels([])\r\nax.set_yticklabels([])\r\n#ax.axis('off')\r\nf.savefig('test_ticks.png', dpi=300, bbox_inches='tight', pad_inches=0, facecolor='red')\r\n\r\n# axis ticks removed\r\nf = plt.figure(figsize=(1,1))\r\nax = f.add_subplot(111)\r\nax.matshow(np.ones((10,10)), cmap=plt.cm.Blues_r, aspect='auto')\r\nax.set_xticklabels([])\r\nax.set_yticklabels([])\r\nax.axis('off')\r\nf.savefig('test_noticks.png', dpi=300, bbox_inches='tight', pad_inches=0, facecolor='red')\r\n```\r\n\r\n**Actual outcome (using matplotlib 2.2.2)**\r\n`test_ticks.png`:\r\n![image](https://user-images.githubusercontent.com/1302022/39789410-ac074a7c-52fd-11e8-8d24-1bca3ab1a9ba.png)\r\nimage dimensions: 239 * 232 pixels\r\n\r\n`test_noticks.png`:\r\n![image](https://user-images.githubusercontent.com/1302022/39789415-afe390a6-52fd-11e8-93ee-b4e15afaba76.png)\r\nimage dimensions: 239 * 232 pixels\r\n\r\n**Expected outcome (using matplotlib 1.5.3)**\r\n`test_ticks.png`:\r\n![image](https://user-images.githubusercontent.com/1302022/39789459-e3503d22-52fd-11e8-9766-5392213e3626.png)\r\nimage dimensions: 232 * 232 pixels\r\n(drawing the ticks inside the plot is obviously not desirable as well but I think this illustrates the difference in behaviour)\r\n\r\n`test_noticks.png`:\r\n![image](https://user-images.githubusercontent.com/1302022/39789460-e7737464-52fd-11e8-8672-61c217ea034c.png)\r\nimage dimensions: 232 * 232 pixels\r\n(this is what I'd like to get with the above code).\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: Ubuntu 16.04 LTS\r\n  * Matplotlib version: 2.2.2\r\n  * Matplotlib backend (`print(matplotlib.get_backend())`): `module://ipykernel.pylab.backend_inline` (also tried in Qt5Agg)\r\n  * Python version: 3.6.5\r\n  * Jupyter version (if applicable): 4.4.0\r\n  * Other libraries: \r\n```\r\nbackcall==0.1.0\r\ncertifi==2018.4.16\r\ncycler==0.10.0\r\nCython==0.28.2\r\ndecorator==4.3.0\r\nipykernel==4.8.2\r\nipython==6.3.1\r\nipython-genutils==0.2.0\r\njedi==0.12.0\r\njupyter-client==5.2.3\r\njupyter-core==4.4.0\r\nkiwisolver==1.0.1\r\nmatplotlib==2.2.2\r\nmkl-fft==1.0.0\r\nmkl-random==1.0.1\r\nnibabel==2.2.1\r\nnilearn==0.4.1\r\nnumpy==1.14.2\r\nolefile==0.45.1\r\nparso==0.2.0\r\npexpect==4.5.0\r\npickleshare==0.7.4\r\nPillow==5.1.0\r\nprompt-toolkit==1.0.15\r\nptyprocess==0.5.2\r\nPygments==2.2.0\r\npyparsing==2.2.0\r\nPyQt5==5.10.1\r\npython-dateutil==2.7.2\r\npytz==2018.4\r\npyzmq==17.0.0\r\nscikit-learn==0.19.1\r\nscipy==1.0.1\r\nsimplegeneric==0.8.1\r\nsip==4.19.8\r\nsix==1.11.0\r\ntornado==5.0.2\r\ntraitlets==4.3.2\r\nwcwidth==0.1.7\r\n```\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\nAll throught conda default channel, the code example was run in two separate virtual environments, one downgraded to matplotlib 1.5.3.\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/surchs","@type":"Person","name":"surchs"},"datePublished":"2018-05-09T00:32:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/11203/matplotlib/issues/11203"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:42c2c2ed-5228-197a-d885-c076e8b734d3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCBE:942D6:43AB2:5DD7A:6A5461BB
html-safe-nonce06a749c25ad16bdf95cb73852f7c679532ddfde84a33827548e59ddc6b73e1f7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0JFOjk0MkQ2OjQzQUIyOjVERDdBOjZBNTQ2MUJCIiwidmlzaXRvcl9pZCI6IjczMDUzNzA2NDA3NDc2MTg3NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac87883b168238bd8be4e5a6add0ca66e34c28a5100eb3000bda00cab03ae5b6e8
hovercard-subject-tagissue:321391376
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/11203/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4bbe34345a13599838f6efc9d607a2ff3ad8f72d3ef1a3a7b79d9e2ce57a8c88/matplotlib/matplotlib/issues/11203
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4bbe34345a13599838f6efc9d607a2ff3ad8f72d3ef1a3a7b79d9e2ce57a8c88/matplotlib/matplotlib/issues/11203
og:image:altBug report tight_layout seems to reserve space for axes ticks even if they are removed I like to save a plot with zero surrounding whitespace. Previously (version 1.5.3) this was possible by settin...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesurchs
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
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
release6d28624802c2f7d9500239dd6870ed7031b7353b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/11203#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F11203
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%2F11203
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/11203
Reloadhttps://github.com/matplotlib/matplotlib/issues/11203
Reloadhttps://github.com/matplotlib/matplotlib/issues/11203
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/11203
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/11203
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 408 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
#11210https://github.com/matplotlib/matplotlib/pull/11210
tight_layout reserves tick space even if disabledhttps://github.com/matplotlib/matplotlib/issues/11203#top
#11210https://github.com/matplotlib/matplotlib/pull/11210
v3.0.0https://github.com/matplotlib/matplotlib/milestone/23
https://github.com/surchs
surchshttps://github.com/surchs
on May 9, 2018https://github.com/matplotlib/matplotlib/issues/11203#issue-321391376
recent changeshttps://matplotlib.org/2.2.2/users/whats_new.html#axes-legends-now-included-in-tight-bbox
https://user-images.githubusercontent.com/1302022/39789410-ac074a7c-52fd-11e8-8d24-1bca3ab1a9ba.png
https://user-images.githubusercontent.com/1302022/39789415-afe390a6-52fd-11e8-93ee-b4e15afaba76.png
https://user-images.githubusercontent.com/1302022/39789459-e3503d22-52fd-11e8-9766-5392213e3626.png
https://user-images.githubusercontent.com/1302022/39789460-e7737464-52fd-11e8-8672-61c217ea034c.png
v3.0.0https://github.com/matplotlib/matplotlib/milestone/23
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.