8000 Colorbar cleanups. by anntzer · Pull Request #17835 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Colorbar cleanups. #17835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,18 +1007,6 @@ def _central_N(self):
nb -= 1
return nb

def _extended_N(self):
"""
Based on the colormap and extend variable, return the
number of boundaries.
"""
N = self.cmap.N + 1
if self.extend == 'both':
N += 2
elif self.extend in ('min', 'max'):
N += 1
return N

def _get_extension_lengths(self, frac, automin, automax, default=0.05):
"""
Return the lengths of colorbar extensions.
Expand Down Expand Up @@ -1267,13 +1255,7 @@ def add_lines(self, CS, erase=True):
raise ValueError('add_lines is only for a ContourSet of lines')
tcolors = [c[0] for c in CS.tcolors]
tlinewidths = [t[0] for t in CS.tlinewidths]
# The following was an attempt to get the colorbar lines
# to follow subsequent changes in the contour lines,
# but more work is needed: specifically, a careful
# look at event sequences, and at how
# to make one object track another automatically.
#tcolors = [col.get_colors()[0] for col in CS.collections]
#tlinewidths = [col.get_linewidth()[0] for lw in CS.collections]
# Wishlist: Make colorbar lines auto-follow changes in contour lines.
ColorbarBase.add_lines(self, CS.levels, tcolors, tlinewidths,
erase=erase)

Expand Down
0