Skip to content

Commit 036f103

Browse files
authored
Merge pull request #22824 from anntzer/ub
Remove some unnecessary extra boundaries for colorbars with extensions.
2 parents c6d4a29 + f6f5e08 commit 036f103

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

examples/specialty_plots/leftventricle_bulleye.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
171171
norm3 = mpl.colors.BoundaryNorm(bounds, cmap3.N)
172172
fig.colorbar(mpl.cm.ScalarMappable(cmap=cmap3, norm=norm3),
173173
cax=axl3,
174-
# to use 'extend', you must specify two extra boundaries:
175-
boundaries=[0] + bounds + [18],
176174
extend='both',
177175
ticks=bounds, # optional
178176
spacing='proportional',

tutorials/colors/colorbar_only.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@
7777
# `~.Figure.colorbar`. For the out-of-range values to display on the colorbar
7878
# without using the *extend* keyword with
7979
# `.colors.BoundaryNorm`, we have to use the *extend* keyword argument directly
80-
# in the colorbar call, and supply an additional boundary on each end of the
81-
# range. Here we also
80+
# in the colorbar call. Here we also
8281
# use the spacing argument to make
8382
# the length of each colorbar segment proportional to its corresponding
8483
# interval.
@@ -94,7 +93,6 @@
9493
fig.colorbar(
9594
mpl.cm.ScalarMappable(cmap=cmap, norm=norm),
9695
cax=ax,
97-
boundaries=[0] + bounds + [13], # Adding values for extensions.
9896
extend='both',
9997
ticks=bounds,
10098
spacing='proportional',
@@ -121,7 +119,6 @@
121119
fig.colorbar(
122120
mpl.cm.ScalarMappable(cmap=cmap, norm=norm),
123121
cax=ax,
124-
boundaries=[-10] + bounds + [10],
125122
extend='both',
126123
extendfrac='auto',
127124
ticks=bounds,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy