Title: FIX: don't round image sizes to pixel if meant to be unsampled by jklymak · Pull Request #25704 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: don't round image sizes to pixel if meant to be unsampled by jklymak · Pull Request #25704 · matplotlib/matplotlib
X Title: FIX: don't round image sizes to pixel if meant to be unsampled by jklymak · Pull Request #25704 · matplotlib/matplotlib
Description: Closes #8981 PR Summary For images we do some pixel rounding, but if we are doing unsampled images (eg imshow(..., interpolation='none')) and saving to a backend that allows rasters (svg, pdf), then we don't want to do the pixel rounding - that just makes the image sizes fractionally too large when that isn't needed at all if we don't resample. All the test images that changed just model my a pixel, and all have imshow(..., interpolation='none'). Old New code import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot([0, 0, 1, 1, 0], [0, 1, 1, 0, 0], color='r', lw=0.1) np.random.seed(19680801) ax.imshow(np.random.randn(16, 16), cmap='Blues', extent=(0, 1, 0, 1), interpolation='none', vmin=-1,vmax=1) ax.set_xlim(-0.1, 1+0.1) ax.set_ylim(-0.1, 1+0.1) PR Checklist Documentation and Tests Has pytest style unit tests (and pytest passes) Documentation is sphinx and numpydoc compliant (the docs should build without error). New plotting related features are documented with examples. Release Notes New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/ API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/ Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst
Open Graph Description: Closes #8981 PR Summary For images we do some pixel rounding, but if we are doing unsampled images (eg imshow(..., interpolation='none')) and saving to a backend that allows rasters (svg, p...
X Description: Closes #8981 PR Summary For images we do some pixel rounding, but if we are doing unsampled images (eg imshow(..., interpolation='none')) and saving to a backend that allows rasters...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/25704
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:eec96327-17b0-78b1-2263-ed3873b59536 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CBF2:3AC7E6:1A2A63B:22A0A7B:6A51CDFC |
| html-safe-nonce | 6a65bdb753dd8db056946e557930f000d7f781d432b73915f065485a5c8262ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkYyOjNBQzdFNjoxQTJBNjNCOjIyQTBBN0I6NkE1MUNERkMiLCJ2aXNpdG9yX2lkIjoiMjE5MTE3MzYzMzM3MTY1NTY3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7784455addc4414bed6b9968b2e54a584e62722d45440d6d17efb558b0d8c3b1 |
| hovercard-subject-tag | pull_request:1315786498 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/25704/files |
| twitter:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| og:image:alt | Closes #8981 PR Summary For images we do some pixel rounding, but if we are doing unsampled images (eg imshow(..., interpolation='none')) and saving to a backend that allows rasters (svg, p... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width