Title: FIX: make add_lines work with new colorbar by jklymak · Pull Request #12461 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: make add_lines work with new colorbar by jklymak · Pull Request #12461 · matplotlib/matplotlib
X Title: FIX: make add_lines work with new colorbar by jklymak · Pull Request #12461 · matplotlib/matplotlib
Description: PR Summary Closes #12458 See below for a less pathological example... cbar.add_lines was not operational after new colorbar changes in 3.0.0. import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np fig = plt.figure() ax = fig.add_axes([0.05, 0.8, 0.9, 0.15]) cmap = mpl.cm.cool norm = mpl.colors.Normalize(vmin=-4, vmax=4) levels = (-1.0, 1.0, 2.0, 3.0) cb = mpl.colorbar.ColorbarBase(ax, cmap=cmap, norm=norm) colors_bg = np.tile(list((1.0, 1.0, 1.0, 1.0)), (len(levels), 1)) cb.add_lines(levels=levels, colors=colors_bg, linewidths=1) Before After import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots() X = np.random.rand(10, 10)*10000 pcm = ax.pcolormesh(X) # add 1000 to make colors visible... cont = ax.contour(X+1000) cb = fig.colorbar(pcm) cb.add_lines(cont) plt.show() Before After 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 Closes #12458 See below for a less pathological example... cbar.add_lines was not operational after new colorbar changes in 3.0.0. import matplotlib.pyplot as plt import matplotlib as mp...
X Description: PR Summary Closes #12458 See below for a less pathological example... cbar.add_lines was not operational after new colorbar changes in 3.0.0. import matplotlib.pyplot as plt import matplotlib as mp...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/12461
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1c29b98b-9b3c-286e-83ac-33671ae4ad1c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CD56:1D8CC3:1727467:1F75CBE:6A52339A |
| html-safe-nonce | ef208b4fee4d1ac4a78a5934da6212a149edb35e1cc4c5d09564dc7a90213bed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDU2OjFEOENDMzoxNzI3NDY3OjFGNzVDQkU6NkE1MjMzOUEiLCJ2aXNpdG9yX2lkIjoiOTE1OTI4MTg4MzgxMjYwNjg3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d191565241a150b16540b96aee18b7697f74a4f66ee56a8001bbf2c1df34270b |
| hovercard-subject-tag | pull_request:221492224 |
| 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/12461/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 | PR Summary Closes #12458 See below for a less pathological example... cbar.add_lines was not operational after new colorbar changes in 3.0.0. import matplotlib.pyplot as plt import matplotlib as mp... |
| 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