Skip to content
Merged
Changes from all commits
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
81 changes: 55 additions & 26 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,19 @@ def _rgb_to_rgba(A):


class _ImageBase(martist.Artist, cm.ScalarMappable):
"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to move this up to avoid it appearing under the AxesImage main docstring (this doesn't affect the docs though since _ImageBase isn't in there).

interpolation and cmap default to their rc settings

cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1

extent is data axes (left, right, bottom, top) for making image plots
registered with data plots. Default is to label the pixel
centers with the zero-based row and column indices.

Additional kwargs are matplotlib.artist properties

"""
zorder = 0

def __init__(self, ax,
Expand All @@ -230,19 +243,6 @@ def __init__(self, ax,
resample=False,
**kwargs
):
"""
interpolation and cmap default to their rc settings

cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1

extent is data axes (left, right, bottom, top) for making image plots
registered with data plots. Default is to label the pixel
centers with the zero-based row and column indices.

Additional kwargs are matplotlib.artist properties

"""
martist.Artist.__init__(self)
cm.ScalarMappable.__init__(self, norm, cmap)
self._mouseover = True
Expand Down Expand Up @@ -822,6 +822,48 @@ def get_filterrad(self):


class AxesImage(_ImageBase):
"""
Parameters
----------
cmap : colors.Colormap
The Colormap instance or registered colormap name used to map scalar
data to colors.
norm : colors.Normalize
Maps luminance to 0-1.
interpolation : str
Supported values are 'none', 'antialiased', 'nearest', 'bilinear',
'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
'sinc', 'lanczos'.
origin : {'upper', 'lower'}
Place the [0, 0] index of the array in the upper left or lower left
corner of the axes. The convention 'upper' is typically used for
matrices and images.
extent : tuple
The data axes (left, right, bottom, top) for making image plots
registered with data plots. Default is to label the pixel
centers with the zero-based row and column indices.
filternorm : bool
A parameter for the antigrain image resize filter
(see the antigrain documentation).
If filternorm is set, the filter normalizes integer values and corrects
the rounding errors. It doesn't do anything with the source floating
point values, it corrects only integers according to the rule of 1.0
which means that any sum of pixel weights must be equal to 1.0. So,
the filter function must produce a graph of the proper shape.
filterrad : float > 0
The filter radius for filters that have a radius parameter, i.e. when
interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
resample : bool
When True, use a full resampling method. When False, only resample when
the output image is larger than the input image.
**kwargs
Additional kwargs are matplotlib.artist properties.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use backticks around matplotlib.artist, sphinx should do it's magic and automatically link to the reference page of the artist. It's pretty cool :)


Notes
-----
interpolation and cmap default to their rc settings
"""
def __str__(self):
return "AxesImage(%g,%g;%gx%g)" % tuple(self.axes.bbox.bounds)

Expand All @@ -836,19 +878,6 @@ def __init__(self, ax,
resample=False,
**kwargs
):
"""
interpolation and cmap default to their rc settings

cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1

extent is data axes (left, right, bottom, top) for making image plots
registered with data plots. Default is to label the pixel
centers with the zero-based row and column indices.

Additional kwargs are matplotlib.artist properties

"""

self._extent = extent

Expand Down