Title: Wrong datalims with empty plots with shared axes · Issue #3118 · matplotlib/matplotlib · GitHub
Open Graph Title: Wrong datalims with empty plots with shared axes · Issue #3118 · matplotlib/matplotlib
X Title: Wrong datalims with empty plots with shared axes · Issue #3118 · matplotlib/matplotlib
Description: import matplotlib.pyplot as plt fig, (ax1, ax2) = plt.subplots(1, 2, True, False) x1 = [1, 2, 3, 4, 5, 6, 7, 8, 9] y1 = [x*x for x in x1] ax1.plot(x1, y1) x2=y2=[] ax2.plot(x2, y2) plt.show() Now ax1.get_xlim() returns erroneous (-0.06, ...
Open Graph Description: import matplotlib.pyplot as plt fig, (ax1, ax2) = plt.subplots(1, 2, True, False) x1 = [1, 2, 3, 4, 5, 6, 7, 8, 9] y1 = [x*x for x in x1] ax1.plot(x1, y1) x2=y2=[] ax2.plot(x2, y2) plt.show() Now a...
X Description: import matplotlib.pyplot as plt fig, (ax1, ax2) = plt.subplots(1, 2, True, False) x1 = [1, 2, 3, 4, 5, 6, 7, 8, 9] y1 = [x*x for x in x1] ax1.plot(x1, y1) x2=y2=[] ax2.plot(x2, y2) plt.show() Now a...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3118
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Wrong datalims with empty plots with shared axes","articleBody":"``` python\nimport matplotlib.pyplot as plt\n\nfig, (ax1, ax2) = plt.subplots(1, 2, True, False)\nx1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]\ny1 = [x*x for x in x1]\nax1.plot(x1, y1)\nx2=y2=[]\nax2.plot(x2, y2)\nplt.show()\n```\n\nNow ax1.get_xlim() returns erroneous (-0.06, 0.06) because when bounding boxes of two plots are united, infinitely small bounding box of ax2 (Bbox('array([[ inf, inf],\\n [-inf, -inf]])')) is considered infinitely large in transforms.BboxBase.union(). E. g. transforms.BboxBase.union([ax1.dataLim, ax2.dataLim]) returns Bbox('array([[-inf, -inf],\\n [ inf, inf]])') which is incorrect.\n\nThis bug prevents correct display of two plots with shared axis while one of them has empty data.\n","author":{"url":"https://github.com/pyatachyok","@type":"Person","name":"pyatachyok"},"datePublished":"2014-06-05T22:49:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/3118/matplotlib/issues/3118"}
| 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:43e385f6-3d63-e20c-f5e4-7028a99bcb97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B992:AB7B3:796F3E:A68CFC:6A55A880 |
| html-safe-nonce | 75c3649cacbcc8c0e9b52d0b88d50d08385a8dc347ec504af46d8efe59ce85c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTkyOkFCN0IzOjc5NkYzRTpBNjhDRkM6NkE1NUE4ODAiLCJ2aXNpdG9yX2lkIjoiNTk3OTY5ODQ5OTE1OTQzNTM5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5520878d3a46f4c231d93e218e31b29c555562e58bffe9ad3a6dc555f2711b8d |
| hovercard-subject-tag | issue:35105309 |
| 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/3118/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a2ab1dfb2716d9695758747792db1a86513105a4059410232eb211722109bcf1/matplotlib/matplotlib/issues/3118 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a2ab1dfb2716d9695758747792db1a86513105a4059410232eb211722109bcf1/matplotlib/matplotlib/issues/3118 |
| og:image:alt | import matplotlib.pyplot as plt fig, (ax1, ax2) = plt.subplots(1, 2, True, False) x1 = [1, 2, 3, 4, 5, 6, 7, 8, 9] y1 = [x*x for x in x1] ax1.plot(x1, y1) x2=y2=[] ax2.plot(x2, y2) plt.show() Now a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pyatachyok |
| 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 | 653fccf1e27344851c0d3de3fa6faa526197f072 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width