Title: aspect='equal' ignored when parasitic axis added with twinx/twiny · Issue #7654 · matplotlib/matplotlib · GitHub
Open Graph Title: aspect='equal' ignored when parasitic axis added with twinx/twiny · Issue #7654 · matplotlib/matplotlib
X Title: aspect='equal' ignored when parasitic axis added with twinx/twiny · Issue #7654 · matplotlib/matplotlib
Description: Consider an axis with equal aspect ratio from matplotlib import pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111, aspect='equal') ax1.grid() plt.show() Adding a parasitic axis with twinx() causes the plot to completely ignore a...
Open Graph Description: Consider an axis with equal aspect ratio from matplotlib import pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111, aspect='equal') ax1.grid() plt.show() Adding a parasitic axis with twinx(...
X Description: Consider an axis with equal aspect ratio from matplotlib import pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111, aspect='equal') ax1.grid() plt.show() Adding a parasitic axis wit...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/7654
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"aspect='equal' ignored when parasitic axis added with twinx/twiny","articleBody":"Consider an axis with equal aspect ratio\r\n\r\n```\r\nfrom matplotlib import pyplot as plt\r\n\r\nfig = plt.figure()\r\nax1 = fig.add_subplot(111, aspect='equal')\r\nax1.grid()\r\nplt.show()\r\n```\r\n\r\n\r\n---\r\n\r\nAdding a parasitic axis with `twinx()` causes the plot to completely ignore `aspect='equal'`\r\n\r\n```\r\nfrom matplotlib import pyplot as plt\r\n\r\nfig = plt.figure()\r\nax1 = fig.add_subplot(111, aspect='equal')\r\nax1.grid()\r\nax2 = ax1.twinx()\r\nplt.show()\r\n```\r\n\r\n\r\n\r\n---\r\n\r\nCreating the primary axis with the keyword argument `adjustable='box-forced'` causes it to obey `aspect='equal'` but the parasitic axis does not.\r\n\r\n```\r\nfrom matplotlib import pyplot as plt\r\n\r\nfig = plt.figure()\r\nax1 = fig.add_subplot(111, adjustable='box-forced', aspect='equal')\r\nax1.grid()\r\nax2 = ax1.twinx()\r\nplt.show()\r\n```\r\n\r\n\r\n\r\n---\r\n\r\nInterestingly, everything works if the primary axis is created with `host_subplot` (note `adjustable='box-forced'` is still required). However, it seems to be prone to a similar issue to #7648 if `figure.autolayout` is set\r\n\r\n```\r\nimport matplotlib.pyplot as plt\r\nfrom mpl_toolkits.axes_grid1 import host_subplot\r\n\r\nfig = plt.figure()\r\nax1 = host_subplot(111, adjustable='box-forced', aspect='equal')\r\nax1.grid()\r\nax2 = ax1.twinx()\r\nplt.show()\r\n```\r\n\r\n\r\n\r\nPlatform: Windows 7\r\nmatplotlib: 1.5.3\r\npython: 2.7.12\r\n","author":{"url":"https://github.com/ndeadly","@type":"Person","name":"ndeadly"},"datePublished":"2016-12-21T11:59:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/7654/matplotlib/issues/7654"}
| 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:f0752d23-977b-b175-0788-a9e5448ff041 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD9C:228F1C:1C072C:252480:6A52E598 |
| html-safe-nonce | effa726509c1ed4aeebada8a1e039d25ca0a3d4cdf072818a5e6b867fe8d7461 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDlDOjIyOEYxQzoxQzA3MkM6MjUyNDgwOjZBNTJFNTk4IiwidmlzaXRvcl9pZCI6IjExNjk1NTc1MDgxNjA5Mzk0MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9c088050c32343acd1a29b3f4a29125a2664359ad9aa60a4f9611bbbc83e809a |
| hovercard-subject-tag | issue:196915678 |
| 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/7654/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2cbbe9353c871dc0bc09459a8b97910b3d9794e492d76ffeb96768b3f16e5c7a/matplotlib/matplotlib/issues/7654 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2cbbe9353c871dc0bc09459a8b97910b3d9794e492d76ffeb96768b3f16e5c7a/matplotlib/matplotlib/issues/7654 |
| og:image:alt | Consider an axis with equal aspect ratio from matplotlib import pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111, aspect='equal') ax1.grid() plt.show() Adding a parasitic axis with twinx(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ndeadly |
| 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