@@ -394,6 +394,7 @@ def __init__(self, ax, *args, **kwargs):
394394 self .extent = kwargs .get ('extent' , None )
395395 cmap = kwargs .get ('cmap' , None )
396396 self .colors = kwargs .get ('colors' , None )
397+ norm = kwargs .get ('norm' , None )
397398 self .clip_ends = kwargs .get ('clip_ends' , True )
398399 self .antialiased = kwargs .get ('antialiased' , True )
399400 self .nchunk = kwargs .get ('nchunk' , 0 )
@@ -417,11 +418,12 @@ def __init__(self, ax, *args, **kwargs):
417418 self .cl = []
418419 self .cl_cvalues = []
419420
420- ScalarMappable .__init__ (self , cmap = cmap ) # sets self.cmap;
421- # default norm for now
421+ kw = {'cmap' : cmap }
422+ if norm is not None :
423+ kw ['norm' ] = norm
424+ ScalarMappable .__init__ (self , ** kw ) # sets self.cmap;
422425 self ._process_colors ()
423426
424-
425427 if self .filled :
426428 if self .linewidths is None :
427429 self .linewidths = 0.05 # Good default for Postscript.
@@ -453,7 +455,6 @@ def __init__(self, ax, *args, **kwargs):
453455
454456 if level < 0.0 and self .monochrome :
455457 col .set_linestyle ((0 , (6. ,6. )),)
456- #print "setting dashed"
457458 col .set_label (str (level )) # only for self-documentation
458459 self .ax .add_collection (col )
459460 self .collections .append (col )
@@ -687,6 +688,11 @@ def _process_linewidths(self):
687688 * cmap = None: a cm Colormap instance from matplotlib.cm.
688689 - if cmap == None and colors == None, a default Colormap is used.
689690
691+ * norm = None: a matplotlib.colors.normalize instance for
692+ scaling data values to colors.
693+ - if norm == None, and colors == None, the default
694+ linear scaling is used.
695+
690696 * origin = None: 'upper'|'lower'|'image'|None.
691697 If 'image', the rc value for image.origin will be used.
692698 If None (default), the first value of Z will correspond
0 commit comments