Title: Issues with autoscaling and transforms with 3.2+ · Issue #17016 · matplotlib/matplotlib · GitHub
Open Graph Title: Issues with autoscaling and transforms with 3.2+ · Issue #17016 · matplotlib/matplotlib
X Title: Issues with autoscaling and transforms with 3.2+ · Issue #17016 · matplotlib/matplotlib
Description: Bug report Bug summary I am encountering a few seemingly related issues but can't exactly define what's happening. They broadly relate to unexpected changes in how plots are scaled and appear in the context of using the transform objects...
Open Graph Description: Bug report Bug summary I am encountering a few seemingly related issues but can't exactly define what's happening. They broadly relate to unexpected changes in how plots are scaled and appear in th...
X Description: Bug report Bug summary I am encountering a few seemingly related issues but can't exactly define what's happening. They broadly relate to unexpected changes in how plots are scaled and appe...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/17016
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issues with autoscaling and transforms with 3.2+","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nI am encountering a few seemingly related issues but can't exactly define what's happening. They broadly relate to unexpected changes in how plots are scaled and appear in the context of using the transform objects attached to the Axes. I assume they are caused by changes in autoscaling in 3.2, but don't know whether they are a bug or if previous code was relying on undefined behavior (the release notes are a little vague about what actually changed).\r\n\r\n**Code for reproduction**\r\n\r\nHere is a simple example derived from an issue in seaborn rugplot (https://github.com/mwaskom/seaborn/issues/2015)\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib as mpl\r\nimport matplotlib.transforms as tx\r\nfrom matplotlib.collections import LineCollection\r\nimport matplotlib.pyplot as plt\r\n\r\na = [1, 2, 4]\r\nheight = .2\r\n\r\nxy_pairs = np.column_stack([np.repeat(a, 2), np.tile([0, height], len(a))])\r\nline_segs = xy_pairs.reshape([len(a), 2, 2])\r\n\r\nf, ax = plt.subplots()\r\ntrans = tx.blended_transform_factory(ax.transData, ax.transAxes)\r\nax.add_collection(LineCollection(line_segs, transform=trans))\r\nax.autoscale_view(scalex=True, scaley=False)\r\n```\r\n\r\n**Actual outcome**\r\n\r\nWith matplotlib 3.2.1:\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nWith matplotlib 3.1.2:\r\n\r\n\r\n\r\n\r\n**Matplotlib version**\r\n\r\n * Operating system: macos\r\n * Matplotlib version: 3.2.1\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): ipython inline\r\n\r\n**Other information**\r\n\r\nLinking another seaborn issue (https://github.com/mwaskom/seaborn/issues/2013) where there has been a similar change in behavior with matplotlib 3.2 but where it's harder to extract a standalone issue.","author":{"url":"https://github.com/mwaskom","@type":"Person","name":"mwaskom"},"datePublished":"2020-04-03T17:14:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/17016/matplotlib/issues/17016"}
| 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:81c96c4c-1af3-61a5-483c-ff073ceebfd6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA8E:16851B:1041:13C3:6A52B0C1 |
| html-safe-nonce | 4c4f07799c74576d7de72c18f3384c0c5521f47638022d42c6e8ba00f03412b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQThFOjE2ODUxQjoxMDQxOjEzQzM6NkE1MkIwQzEiLCJ2aXNpdG9yX2lkIjoiNjQ3NzM4NTQ3OTYyNTAyNzc3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6b82ae7707426c4e20810f48f2c92da554b96afcf7a793a4bd90f33b06377260 |
| hovercard-subject-tag | issue:593525063 |
| 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/17016/issue_layout |
| twitter:image | https://opengraph.githubassets.com/211f08711d9d262b275772603bdf01cd81e4109ff4af0a9029744a9930e42438/matplotlib/matplotlib/issues/17016 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/211f08711d9d262b275772603bdf01cd81e4109ff4af0a9029744a9930e42438/matplotlib/matplotlib/issues/17016 |
| og:image:alt | Bug report Bug summary I am encountering a few seemingly related issues but can't exactly define what's happening. They broadly relate to unexpected changes in how plots are scaled and appear in th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mwaskom |
| 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