1313
1414def get_cmap (name = None , lut = None ):
1515 """
16- Get a colormap instance, defaulting to rc values if name is None
16+ Get a colormap instance, defaulting to rc values if * name* is None
1717 """
1818 if name is None : name = mpl .rcParams ['image.cmap' ]
1919 if lut is None : lut = mpl .rcParams ['image.lut' ]
@@ -29,8 +29,9 @@ class ScalarMappable:
2929
3030 def __init__ (self , norm = None , cmap = None ):
3131 """
32- norm is a colors.normalize instance to map luminance to 0-1
33- cmap is a cm colormap instance
32+ *norm* is an instance of :class:`colors.Normalize` or one of
33+ its subclasses, used to map luminance to 0-1. *cmap* is a
34+ :mod:`cm` colormap instance, for example :data:`cm.jet`
3435 """
3536
3637 self .callbacksSM = cbook .CallbackRegistry ((
@@ -50,10 +51,10 @@ def set_colorbar(self, im, ax):
5051 self .colorbar = im , ax
5152
5253 def to_rgba (self , x , alpha = 1.0 , bytes = False ):
53- '''Return a normalized rgba array corresponding to x.
54- If x is already an rgb array, insert alpha; if it is
55- already rgba, return it unchanged.
56- If bytes is True, return rgba as 4 uint8s instead of 4 floats.
54+ '''Return a normalized rgba array corresponding to *x*. If *x*
55+ is already an rgb array, insert * alpha* ; if it is already
56+ rgba, return it unchanged. If *bytes* is True, return rgba as
57+ 4 uint8s instead of 4 floats.
5758 '''
5859 try :
5960 if x .ndim == 3 :
@@ -79,7 +80,7 @@ def to_rgba(self, x, alpha=1.0, bytes=False):
7980 return x
8081
8182 def set_array (self , A ):
82- 'Set the image array from numpy array A '
83+ 'Set the image array from numpy array *A* '
8384 self ._A = A
8485 self .update_dict ['array' ] = True
8586
@@ -97,8 +98,8 @@ def get_clim(self):
9798
9899 def set_clim (self , vmin = None , vmax = None ):
99100 """
100- set the norm limits for image scaling; if vmin is a length2
101- sequence, interpret it as (vmin, vmax) which is used to
101+ set the norm limits for image scaling; if * vmin* is a length2
102+ sequence, interpret it as `` (vmin, vmax)`` which is used to
102103 support setp
103104
104105 ACCEPTS: a length 2 sequence of floats
0 commit comments