Title: tight_layout + lots of subplots + long ylabels inverts yaxis · Issue #8062 · matplotlib/matplotlib · GitHub
Open Graph Title: tight_layout + lots of subplots + long ylabels inverts yaxis · Issue #8062 · matplotlib/matplotlib
X Title: tight_layout + lots of subplots + long ylabels inverts yaxis · Issue #8062 · matplotlib/matplotlib
Description: When plotting a lot of subplots (here 6), with long y-labels and tight_layout, the y-axis is reverted. In this example, it is particularly striking as I am plotting histograms. import matplotlib.pyplot as plt import numpy as np alphas = ...
Open Graph Description: When plotting a lot of subplots (here 6), with long y-labels and tight_layout, the y-axis is reverted. In this example, it is particularly striking as I am plotting histograms. import matplotlib.py...
X Description: When plotting a lot of subplots (here 6), with long y-labels and tight_layout, the y-axis is reverted. In this example, it is particularly striking as I am plotting histograms. import matplotlib.py...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8062
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tight_layout + lots of subplots + long ylabels inverts yaxis","articleBody":"When plotting a lot of subplots (here 6), with long y-labels *and* tight_layout, the y-axis is reverted.\r\nIn this example, it is particularly striking as I am plotting histograms.\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nalphas = [0.001, 0.1, 1, 10, 1000, 10000]\r\nX = np.random.randn(len(alphas), 1000)\r\n\r\nfig, axes = plt.subplots(nrows=len(alphas), ncols=2)\r\nfig.set_tight_layout(True)\r\nfor i, alpha in enumerate(alphas):\r\n ax = axes[i, 0]\r\n ax.hist(X[i])\r\n ax.set_xlabel(\"Number of features\", fontweight=\"bold\")\r\n ax.set_ylabel(\"Number of genes\", fontweight=\"bold\")\r\n\r\n ax = axes[i, 1]\r\n ax.plot(sorted(X[i]))\r\n ax.set_ylabel(\"Number of genes\", fontweight=\"bold\")\r\n```\r\n\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nRemoving the tight layout, the labels collapse, but at least the plots are oriented the correct way.\r\n\r\n\r\n\r\nMatplotlib should ~~either raise a proper error~~ raise a proper warning, or plot the histograms in the proper order.\r\n\r\n\r\n**Matplotlib version**\r\n\r\nMatplotlib 2.0.0\r\n\r\n","author":{"url":"https://github.com/NelleV","@type":"Person","name":"NelleV"},"datePublished":"2017-02-10T23:19:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/8062/matplotlib/issues/8062"}
| 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:6936ba15-f196-0dd3-4818-d4d76a9aab7a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 97EC:52373:15FCE07:1E43ABD:6A55D9A8 |
| html-safe-nonce | 2b1492b73191e7c24d8ea8c79c70c8e5f1caf39acb6060bc9e3f703d33763862 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0VDOjUyMzczOjE1RkNFMDc6MUU0M0FCRDo2QTU1RDlBOCIsInZpc2l0b3JfaWQiOiI3OTczMzEyNTI1NzEzNjYwMzI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 142c5bebee8f5fb15f36eac171aea19afbb272bf1df3e6a738d99fe2386ec432 |
| hovercard-subject-tag | issue:206931356 |
| 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/8062/issue_layout |
| twitter:image | https://opengraph.githubassets.com/21cbba9ca8b950ab206b073bc837054b7bb22b42aa330a188ea753da5de144a9/matplotlib/matplotlib/issues/8062 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/21cbba9ca8b950ab206b073bc837054b7bb22b42aa330a188ea753da5de144a9/matplotlib/matplotlib/issues/8062 |
| og:image:alt | When plotting a lot of subplots (here 6), with long y-labels and tight_layout, the y-axis is reverted. In this example, it is particularly striking as I am plotting histograms. import matplotlib.py... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NelleV |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| 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 | 8f8e1726192df8dce16872ceb503336c12e9ae78 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width