Title: Allow using masked in `set_offsets` by chahak13 · Pull Request #24757 · matplotlib/matplotlib · GitHub
Open Graph Title: Allow using masked in `set_offsets` by chahak13 · Pull Request #24757 · matplotlib/matplotlib
X Title: Allow using masked in `set_offsets` by chahak13 · Pull Request #24757 · matplotlib/matplotlib
Description: PR Summary scatter allows using masked arrays as data and it also respects it by not plotting the masked points (#24545 , #24732 , #24733). But, if the offsets are updated using set_offsets and the input data is a masked array, the mask information is lost in set_offsets and the new plot contains all the points. A quick example: import numpy as np import matplotlib.pyplot as plt x = np.ma.array([1, 2, 3, 4, 5], mask=[0, 0, 1, 1, 0]) y = np.arange(1, 6) fig, ax = plt.subplots() scat = ax.scatter(x, y) x = x/ 2 scat.set_offsets(np.ma.column_stack([x, y])) ax.set_xlim(0, 6) plt.show() Current behaviour: Proposed behaviour: This is a small effort in lines with #24733 . PR Checklist Documentation and Tests Has pytest style unit tests (and pytest passes) [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error). [n/a] New plotting related features are documented with examples. Release Notes [n/a] New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/ [n/a] API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/ [n/a] Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst
Open Graph Description: PR Summary scatter allows using masked arrays as data and it also respects it by not plotting the masked points (#24545 , #24732 , #24733). But, if the offsets are updated using set_offsets and the...
X Description: PR Summary scatter allows using masked arrays as data and it also respects it by not plotting the masked points (#24545 , #24732 , #24733). But, if the offsets are updated using set_offsets and the...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/24757
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0055e57a-986f-dbc0-cbe7-6968a83a4f77 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E148:56830:D89CCE:11E1F70:6A519808 |
| html-safe-nonce | d24bff91512fb6040553b20f16fef7a087cbdd0071fc7e1aef1a4e90a7c08fd1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTQ4OjU2ODMwOkQ4OUNDRToxMUUxRjcwOjZBNTE5ODA4IiwidmlzaXRvcl9pZCI6IjU2MjIzODM2NTU2NTU2NzU5MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3f866722ff7e65ef71835b80f1d8ac65c314f3f9ce540c793c02b286be556e11 |
| hovercard-subject-tag | pull_request:1169384537 |
| 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/24757/files |
| twitter:image | https://avatars.githubusercontent.com/u/29800965?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/29800965?s=400&v=4 |
| og:image:alt | PR Summary scatter allows using masked arrays as data and it also respects it by not plotting the masked points (#24545 , #24732 , #24733). But, if the offsets are updated using set_offsets and the... |
| 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