Title: Add capstyle and joinstyle attributes to Collection class (Issue #8277) by simonpf · Pull Request #9523 · matplotlib/matplotlib · GitHub
Open Graph Title: Add capstyle and joinstyle attributes to Collection class (Issue #8277) by simonpf · Pull Request #9523 · matplotlib/matplotlib
X Title: Add capstyle and joinstyle attributes to Collection class (Issue #8277) by simonpf · Pull Request #9523 · matplotlib/matplotlib
Description: PR Summary Adds _capstyle and _joinstyle attributes as well as corresponding setters to Collection class. Changes draw class method to set capstyle and joinstyle of renderer accordingly. This solves the problem of not being able to set capstyle and joinstyle of LineCollection (Issue #8277). PR Checklist Has Pytest style unit tests Code is PEP 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 Example import matplotlib.pyplot as plt from matplotlib.collections import LineCollection from matplotlib import colors as mcolors import numpy as np x = np.arange(100) ys = x[::10, np.newaxis] + (x + 10.0 * np.random.rand(*x.shape))[np.newaxis, :] segs = np.zeros((10, 100, 2), float) segs[:, :, 1] = ys segs[:, :, 0] = x segs = np.ma.masked_where((segs > 50) & (segs < 60), segs) ax = plt.axes() ax.set_xlim(x.min(), x.max()) ax.set_ylim(ys.min(), ys.max()) colors = [mcolors.to_rgba(c) for c in plt.rcParams['axes.prop_cycle'].by_key()['color']] line_segments = LineCollection(segs, linewidths=(2, 3, 4, 5), colors=colors, linestyle='solid') line_segments.set_joinstyle("miter") line_segments.set_capstyle("round") ax.add_collection(line_segments) ax.set_title('Line collection with masked arrays') plt.show()
Open Graph Description: PR Summary Adds _capstyle and _joinstyle attributes as well as corresponding setters to Collection class. Changes draw class method to set capstyle and joinstyle of renderer accordingly. This sol...
X Description: PR Summary Adds _capstyle and _joinstyle attributes as well as corresponding setters to Collection class. Changes draw class method to set capstyle and joinstyle of renderer accordingly. This sol...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/9523
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:503f73c7-ce4c-e445-78c0-7ca967d2583f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 92FA:A6D52:6262B02:8A2F46A:6A502E31 |
| html-safe-nonce | f7220191b55b992ce1012a7fa3782a17b4e58f4958508e1e1e95545c5bcc1800 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkZBOkE2RDUyOjYyNjJCMDI6OEEyRjQ2QTo2QTUwMkUzMSIsInZpc2l0b3JfaWQiOiI5MTUxNzE5OTYyNTI3NjczOTA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 96c6a8c2b8d32c27306fd32864cb5c6306c595b715853052a39e7167f5ac3439 |
| hovercard-subject-tag | pull_request:148003711 |
| 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/9523/files |
| twitter:image | https://avatars.githubusercontent.com/u/6934149?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6934149?s=400&v=4 |
| og:image:alt | PR Summary Adds _capstyle and _joinstyle attributes as well as corresponding setters to Collection class. Changes draw class method to set capstyle and joinstyle of renderer accordingly. This sol... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | d90666eaf032b7eb8975a378efe38e37f4ebb96c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width