@@ -219,6 +219,8 @@ def _rgb_to_rgba(A):
219
219
220
220
class _ImageBase (martist .Artist , cm .ScalarMappable ):
221
221
"""
222
+ Base class for images.
223
+
222
224
interpolation and cmap default to their rc settings
223
225
224
226
cmap is a colors.Colormap instance
@@ -229,7 +231,6 @@ class _ImageBase(martist.Artist, cm.ScalarMappable):
229
231
centers with the zero-based row and column indices.
230
232
231
233
Additional kwargs are matplotlib.artist properties
232
-
233
234
"""
234
235
zorder = 0
235
236
@@ -266,7 +267,7 @@ def __getstate__(self):
266
267
return state
267
268
268
269
def get_size (self ):
269
- """Get the numrows, numcols of the input image"""
270
+ """Return the size of the image as tuple (numrows, numcols). """
270
271
if self ._A is None :
271
272
raise RuntimeError ('You must first set the image array' )
272
273
@@ -832,44 +833,42 @@ class AxesImage(_ImageBase):
832
833
"""
833
834
Parameters
834
835
----------
835
- cmap : colors.Colormap
836
+ ax : `~.axes.Axes`
837
+ The axes the image will belong to.
838
+ cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
836
839
The Colormap instance or registered colormap name used to map scalar
837
840
data to colors.
838
- norm : colors.Normalize
841
+ norm : `~matplotlib. colors.Normalize`
839
842
Maps luminance to 0-1.
840
- interpolation : str
843
+ interpolation : str, default: :rc:`image.interpolation`
841
844
Supported values are 'none', 'antialiased', 'nearest', 'bilinear',
842
845
'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
843
846
'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
844
847
'sinc', 'lanczos'.
845
- origin : {'upper', 'lower'}
848
+ origin : {'upper', 'lower'}, default: :rc:`image.origin`
846
849
Place the [0, 0] index of the array in the upper left or lower left
847
850
corner of the axes. The convention 'upper' is typically used for
848
851
matrices and images.
849
- extent : tuple
852
+ extent : tuple, optional
850
853
The data axes (left, right, bottom, top) for making image plots
851
854
registered with data plots. Default is to label the pixel
852
855
centers with the zero-based row and column indices.
853
- filternorm : bool
856
+ filternorm : bool, default: True
854
857
A parameter for the antigrain image resize filter
855
858
(see the antigrain documentation).
856
859
If filternorm is set, the filter normalizes integer values and corrects
857
860
the rounding errors. It doesn't do anything with the source floating
858
861
point values, it corrects only integers according to the rule of 1.0
859
862
which means that any sum of pixel weights must be equal to 1.0. So,
860
863
the filter function must produce a graph of the proper shape.
861
- filterrad : float > 0
864
+ filterrad : float > 0, default: 4
862
865
The filter radius for filters that have a radius parameter, i.e. when
863
866
interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
864
- resample : bool
867
+ resample : bool, default: False
865
868
When True, use a full resampling method. When False, only resample when
866
869
the output image is larger than the input image.
867
- **kwargs
868
- Additional kwargs are matplotlib.artist properties.
870
+ **kwargs : `.Artist` properties
869
871
870
- Notes
871
- -----
872
- interpolation and cmap default to their rc settings
873
872
"""
874
873
def __str__ (self ):
875
874
return "AxesImage(%g,%g;%gx%g)" % tuple (self .axes .bbox .bounds )
@@ -936,9 +935,9 @@ def set_extent(self, extent):
936
935
937
936
Notes
938
937
-----
939
- This updates ``ax.dataLim`, and, if autoscaling, sets ``ax.viewLim``
938
+ This updates ``ax.dataLim`` , and, if autoscaling, sets ``ax.viewLim``
940
939
to tightly fit the image, regardless of ``dataLim``. Autoscaling
941
- state is not changed, so following this with ax.autoscale_view
940
+ state is not changed, so following this with `` ax.autoscale_view()``
942
941
will redo the autoscaling in accord with ``dataLim``.
943
942
"""
944
943
self ._extent = xmin , xmax , ymin , ymax = extent
0 commit comments