Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Commit6e95994
DOC: Add note about linear colorbar scale option for TwoSlopeNorm (#30639)
* DOC: Add note about linear colorbar scale option for TwoSlopeNormAddresses#22197 by documenting the cb.ax.set_yscale('linear')workaround for users who prefer linear colorbar spacing instead ofthe default scaled spacing introduced in matplotlib 3.5.* FIX: Apply pre-commit fixes (end-of-file and line endings)* FIX: Use proper reStructuredText markup for inline code and class references* DOC: Add visual example comparing scaled vs linear colorbar for TwoSlopeNormReplace note with side-by-side example showing:- Left: Default scaled colorbar (centered at midpoint)- Right: Linear colorbar using cb.ax.set_yscale('linear')Addresses maintainer feedback from@jklymak to make the differencemore clear with a visual demonstration.* DOC: Refine TwoSlopeNorm colorbar documentation per maintainer feedback- Change title from 'norms with a scale' to TwoSlopeNorm-specific- Clarify that colorbar is divided into two equal parts- Explain screen-space vs data range difference- Note that color-to-value mapping remains unchanged- Address review comments from@timhoffm* FIX: Add proper reStructuredText markup for code references- Add backticks around .TwoSlopeNorm class reference- Use double backticks for cb.ax.set_yscale('linear') code snippet- Fixes documentation build errors* Update galleries/users_explain/colors/colormapnorms.pyCo-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>* DOC: Address jklymak review feedback on colorbar explanation- Rewrite explanation to avoid 'screen space' term per jklymak- Clarify that colorbars adopt their norm's scaling by default- Better explain TwoSlopeNorm splits colormap evenly between halves- Change tick specification to use np.arange for clarity- Update both cb1 and cb2 to use np.arange(-500, 4001, 500)Addresses@jklymak review comments* FIX: Resolve linting errors- Fix E501: Break long line (line 289) to stay under 88 character limit- Fix E302: Add missing blank line before function definitionAll ruff checks now pass.* FIX: Remove square brackets from np.arange in set_ticks callsThe set_ticks() method expects a 1D array with shape (N,), but wrappingnp.arange() in square brackets creates a list containing an array withshape (1, N). This fixes the ValueError by passing the array directly.* Update galleries/users_explain/colors/colormapnorms.pyCo-authored-by: Jody Klymak <jklymak@gmail.com>* FIX: Remove extra blank line before section markerPrecommit linter expects only one blank line before # %% markers.* FIX: Ensure file ends with single newlineThe end-of-file-fixer precommit hook requires files to endwith exactly one newline, not multiple.* Update galleries/users_explain/colors/colormapnorms.pyCo-authored-by: Jody Klymak <jklymak@gmail.com>* Refactor TwoSlopeNorm colorbar example to use loop- Replace repeated code blocks with a loop as suggested by jklymak- Iterate over both axes with corresponding titles- Act on the last colorbar (cb) to set linear scale for right plot- Reduces code duplication and improves maintainability* Fix linting errors: line length and inline comment spacing- Wrap long comment lines to stay within 88 character limit- Split zip() arguments across lines for better readability- Add blank line before section marker- All ruff checks now pass---------Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>Co-authored-by: Jody Klymak <jklymak@gmail.com>1 parentf380a44 commit6e95994
1 file changed
+27
-0
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
281 | 281 |
| |
282 | 282 |
| |
283 | 283 |
| |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
284 | 310 |
| |
285 | 311 |
| |
286 | 312 |
| |
| |||
290 | 316 |
| |
291 | 317 |
| |
292 | 318 |
| |
| 319 | + | |
293 | 320 |
| |
294 | 321 |
| |
295 | 322 |
| |
|
0 commit comments
Comments
(0)