8000 Colorbar cleanups. · matplotlib/matplotlib@aa387f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit aa387f8

Browse files
committed
Colorbar cleanups.
- Remove unused colorbar private method _extended_N: This method appears to never ever have been used ever since it was added to the codebase. - Shorten a comment about a wishlist item, and delete commented code which is clearly similar to the uncommented one just above.
1 parent dbea6f8 commit aa387f8

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,18 +1007,6 @@ def _central_N(self):
10071007
nb -= 1
10081008
return nb
10091009

1010-
def _extended_N(self):
1011-
"""
1012-
Based on the colormap and extend variable, return the
1013-
number of boundaries.
1014-
"""
1015-
N = self.cmap.N + 1
1016-
if self.extend == 'both':
1017-
N += 2
1018-
elif self.extend in ('min', 'max'):
1019-
N += 1
1020-
return N
1021-
10221010
def _get_extension_lengths(self, frac, automin, automax, default=0.05):
10231011
"""
10241012
Return the lengths of colorbar extensions.
@@ -1267,13 +1255,7 @@ def add_lines(self, CS, erase=True):
12671255
raise ValueError('add_lines is only for a ContourSet of lines')
12681256
tcolors = [c[0] for c in CS.tcolors]
12691257
tlinewidths = [t[0] for t in CS.tlinewidths]
1270-
# The following was an attempt to get the colorbar lines
1271-
# to follow subsequent changes in the contour lines,
1272-
# but more work is needed: specifically, a careful
1273-
# look at event sequences, and at how
1274-
# to make one object track another automatically.
1275-
#tcolors = [col.get_colors()[0] for col in CS.collections]
1276-
#tlinewidths = [col.get_linewidth()[0] for lw in CS.collections]
1258+
# Wishlist: Make colorbar lines auto-follow changes in contour lines.
12771259
ColorbarBase.add_lines(self, CS.levels, tcolors, tlinewidths,
12781260
erase=erase)
12791261

0 commit comments

Comments
 (0)
0