Skip to content
Merged
Changes from 1 commit
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
Next Next commit
colors: Replace docstring ''' with """
  • Loading branch information
bgamari committed Mar 10, 2014
commit 9b29988f3ff6f0655aa2036202c308d896ce6e3a
34 changes: 17 additions & 17 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,24 +625,24 @@ def __call__(self, X, alpha=None, bytes=False):
return rgba

def set_bad(self, color='k', alpha=None):
'''Set color to be used for masked values.
'''
"""Set color to be used for masked values.
"""
self._rgba_bad = colorConverter.to_rgba(color, alpha)
if self._isinit:
self._set_extremes()

def set_under(self, color='k', alpha=None):
'''Set color to be used for low out-of-range values.
"""Set color to be used for low out-of-range values.
Requires norm.clip = False
'''
"""
self._rgba_under = colorConverter.to_rgba(color, alpha)
if self._isinit:
self._set_extremes()

def set_over(self, color='k', alpha=None):
'''Set color to be used for high out-of-range values.
"""Set color to be used for high out-of-range values.
Requires norm.clip = False
'''
"""
self._rgba_over = colorConverter.to_rgba(color, alpha)
if self._isinit:
self._set_extremes()
Expand All @@ -659,7 +659,7 @@ def _set_extremes(self):
self._lut[self._i_bad] = self._rgba_bad

def _init(self):
'''Generate the lookup table, self._lut'''
"""Generate the lookup table, self._lut"""
raise NotImplementedError("Abstract class only")

def is_gray(self):
Expand Down Expand Up @@ -945,9 +945,9 @@ def inverse(self, value):
return vmin + value * (vmax - vmin)

def autoscale(self, A):
'''
"""
Set *vmin*, *vmax* to min, max of *A*.
'''
"""
self.vmin = ma.min(A)
self.vmax = ma.max(A)

Expand Down Expand Up @@ -1016,9 +1016,9 @@ def inverse(self, value):
return vmin * pow((vmax / vmin), value)

def autoscale(self, A):
'''
"""
Set *vmin*, *vmax* to min, max of *A*.
'''
"""
A = ma.masked_less_equal(A, 0, copy=False)
self.vmin = ma.min(A)
self.vmax = ma.max(A)
Expand Down Expand Up @@ -1149,7 +1149,7 @@ def autoscale_None(self, A):


class BoundaryNorm(Normalize):
'''
"""
Generate a colormap index based on discrete intervals.

Unlike :class:`Normalize` or :class:`LogNorm`,
Expand All @@ -1160,9 +1160,9 @@ class BoundaryNorm(Normalize):
piece-wise linear interpolation, but using integers seems
simpler, and reduces the number of conversions back and forth
between integer and floating point.
'''
"""
def __init__(self, boundaries, ncolors, clip=False):
'''
"""
*boundaries*
a monotonically increasing sequence
*ncolors*
Expand All @@ -1179,7 +1179,7 @@ def __init__(self, boundaries, ncolors, clip=False):
Out-of-range values are mapped to -1 if low and ncolors
if high; these are converted to valid indices by
:meth:`Colormap.__call__` .
'''
"""
self.clip = clip
self.vmin = boundaries[0]
self.vmax = boundaries[-1]
Expand Down Expand Up @@ -1217,11 +1217,11 @@ def inverse(self, value):


class NoNorm(Normalize):
'''
"""
Dummy replacement for Normalize, for the case where we
want to use indices directly in a
:class:`~matplotlib.cm.ScalarMappable` .
'''
"""
def __call__(self, value, clip=None):
return value

Expand Down