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

Skip to content

Commit 92cdccd

Browse files
NelleVMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #15523: numpydoc AxesImage
1 parent d52ce8c commit 92cdccd

File tree

1 file changed

+55
-26
lines changed

1 file changed

+55
-26
lines changed

lib/matplotlib/image.py

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ def _rgb_to_rgba(A):
218218

219219

220220
class _ImageBase(martist.Artist, cm.ScalarMappable):
221+
"""
222+
interpolation and cmap default to their rc settings
223+
224+
cmap is a colors.Colormap instance
225+
norm is a colors.Normalize instance to map luminance to 0-1
226+
227+
extent is data axes (left, right, bottom, top) for making image plots
228+
registered with data plots. Default is to label the pixel
229+
centers with the zero-based row and column indices.
230+
231+
Additional kwargs are matplotlib.artist properties
232+
233+
"""
221234
zorder = 0
222235

223236
def __init__(self, ax,
@@ -230,19 +243,6 @@ def __init__(self, ax,
230243
resample=False,
231244
**kwargs
232245
):
233-
"""
234-
interpolation and cmap default to their rc settings
235-
236-
cmap is a colors.Colormap instance
237-
norm is a colors.Normalize instance to map luminance to 0-1
238-
239-
extent is data axes (left, right, bottom, top) for making image plots
240-
registered with data plots. Default is to label the pixel
241-
centers with the zero-based row and column indices.
242-
243-
Additional kwargs are matplotlib.artist properties
244-
245-
"""
246246
martist.Artist.__init__(self)
247247
cm.ScalarMappable.__init__(self, norm, cmap)
248248
self._mouseover = True
@@ -829,6 +829,48 @@ def get_filterrad(self):
829829

830830

831831
class AxesImage(_ImageBase):
832+
"""
833+
Parameters
834+
----------
835+
cmap : colors.Colormap
836+
The Colormap instance or registered colormap name used to map scalar
837+
data to colors.
838+
norm : colors.Normalize
839+
Maps luminance to 0-1.
840+
interpolation : str
841+
Supported values are 'none', 'antialiased', 'nearest', 'bilinear',
842+
'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
843+
'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
844+
'sinc', 'lanczos'.
845+
origin : {'upper', 'lower'}
846+
Place the [0, 0] index of the array in the upper left or lower left
847+
corner of the axes. The convention 'upper' is typically used for
848+
matrices and images.
849+
extent : tuple
850+
The data axes (left, right, bottom, top) for making image plots
851+
registered with data plots. Default is to label the pixel
852+
centers with the zero-based row and column indices.
853+
filternorm : bool
854+
A parameter for the antigrain image resize filter
855+
(see the antigrain documentation).
856+
If filternorm is set, the filter normalizes integer values and corrects
857+
the rounding errors. It doesn't do anything with the source floating
858+
point values, it corrects only integers according to the rule of 1.0
859+
which means that any sum of pixel weights must be equal to 1.0. So,
860+
the filter function must produce a graph of the proper shape.
861+
filterrad : float > 0
862+
The filter radius for filters that have a radius parameter, i.e. when
863+
interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
864+
resample : bool
865+
When True, use a full resampling method. When False, only resample when
866+
the output image is larger than the input image.
867+
**kwargs
868+
Additional kwargs are matplotlib.artist properties.
869+
870+
Notes
871+
-----
872+
interpolation and cmap default to their rc settings
873+
"""
832874
def __str__(self):
833875
return "AxesImage(%g,%g;%gx%g)" % tuple(self.axes.bbox.bounds)
834876

@@ -843,19 +885,6 @@ def __init__(self, ax,
843885
resample=False,
844886
**kwargs
845887
):
846-
"""
847-
interpolation and cmap default to their rc settings
848-
849-
cmap is a colors.Colormap instance
850-
norm is a colors.Normalize instance to map luminance to 0-1
851-
852-
extent is data axes (left, right, bottom, top) for making image plots
853-
registered with data plots. Default is to label the pixel
854-
centers with the zero-based row and column indices.
855-
856-
Additional kwargs are matplotlib.artist properties
857-
858-
"""
859888

860889
self._extent = extent
861890

0 commit comments

Comments
 (0)