Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f29f8dc

Browse files
author
Jeff Whitaker
committed
added ContourMappable attribute 'level_upper' (needed for colorbar)
svn path=/trunk/matplotlib/; revision=1675
1 parent 8c83295 commit f29f8dc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/matplotlib/contour.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def changed(self):
8686

8787
ScalarMappable.changed(self)
8888

89+
8990
class ContourLabeler:
9091
def __init__(self, ax):
9192
self.ax = ax
@@ -691,6 +692,8 @@ def contour(self, *args, **kwargs):
691692

692693
tcolors, mappable, collections = self._process_colors(colors,
693694
alpha, lev, cmap)
695+
if mappable is not None:
696+
mappable.level_upper = None
694697

695698
if linewidths == None:
696699
tlinewidths = [rcParams['lines.linewidth']] *Nlev
@@ -803,6 +806,7 @@ def contourf(self, *args, **kwargs):
803806
tcolors, mappable, collections = self._process_colors(colors,
804807
alpha,
805808
lev[:-1], cmap)
809+
mappable.level_upper = lev[-1]
806810

807811
C = _contour.Cntr(x, y, z.filled(), z.mask())
808812
for level, level_upper, color in zip(lev[:-1], lev[1:], tcolors):

0 commit comments

Comments
 (0)