Title: BUGFIX: scatter should draw ',' as a single pixel by brunobeltran · Pull Request #17367 · matplotlib/matplotlib · GitHub
Open Graph Title: BUGFIX: scatter should draw ',' as a single pixel by brunobeltran · Pull Request #17367 · matplotlib/matplotlib
X Title: BUGFIX: scatter should draw ',' as a single pixel by brunobeltran · Pull Request #17367 · matplotlib/matplotlib
Description: PR Summary Attempt to fix #11460. Instead of adding a special case to PathCollection, which (IMO, and I am happy to be told I'm wrong about this) has no business knowing that the path it's drawing came from a MarkerStyle at all, let alone that it came from the weird, special-case marker ',', I added a kwarg to _CollectionWithSizes that allows one to specify that the self-same sizes should actually just be ignored. With this in place, Axes.scatter (which does know that we are using MarkerStyle) can pass the appropriate Path to PathCollection (of width one) and ask the PathCollection to ignore the scaling information, which is what that particular marker is supposed to do, I think. WIP because I can't seem to figure out one last little issue, where what appear to be identical inputs are being sent to Agg's draw_marker and producing two different results (off-by-one pixel). Test Cases import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot(0, 0, marker=',') plt.savefig('plot_single_pixel.png') fig, ax = plt.subplots() ax.scatter(0, 0, marker=',', edgecolors='none') plt.savefig('scatter_single_pixel.png') Output (Screenshots from GIMP to make it more clear exactly what the error is) plot case (correctly one pixel): scatter case currently in master (many pixels...): scatter case in current PR (almost correct): PR Checklist Has Pytest style unit tests Code is Flake 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: PR Summary Attempt to fix #11460. Instead of adding a special case to PathCollection, which (IMO, and I am happy to be told I'm wrong about this) has no business knowing that the path it's ...
X Description: PR Summary Attempt to fix #11460. Instead of adding a special case to PathCollection, which (IMO, and I am happy to be told I'm wrong about this) has no business knowing that the path it&am...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/17367
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:335b1a35-83bf-d069-3c65-1dddd55af167 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BDFA:191DCC:1EA1650:290C1F2:6A537697 |
| html-safe-nonce | eba82724afd90b4cd778f68ba65c22560eab8d78cda8b04c3f7b62a3f22f35c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREZBOjE5MURDQzoxRUExNjUwOjI5MEMxRjI6NkE1Mzc2OTciLCJ2aXNpdG9yX2lkIjoiMjk5NjAyMjg5NjU5MjM4NTY4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 93abc76aa252b68c7262ecc7335ee928107d2b85e518b8a7724268c221b82dad |
| hovercard-subject-tag | pull_request:415393197 |
| 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/17367/files |
| twitter:image | https://avatars.githubusercontent.com/u/1475390?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1475390?s=400&v=4 |
| og:image:alt | PR Summary Attempt to fix #11460. Instead of adding a special case to PathCollection, which (IMO, and I am happy to be told I'm wrong about this) has no business knowing that the path it's ... |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width