10000 Remove some unnecessary extra boundaries for colorbars with extensions. · matplotlib/matplotlib@f6f5e08 · GitHub
[go: up one dir, main page]

Skip to content

Commit f6f5e08

Browse files
committed
Remove some unnecessary extra boundaries for colorbars with extensions.
AFAICT these do not affect the resulting colorbar at all (run the code before and after to compare).
1 parent 25c85f0 commit f6f5e08

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)
0