-
-
Notifications
You must be signed in to change notification settings - Fork 8k
numpydoc AxesImage #15523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
numpydoc AxesImage #15523
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,6 +218,19 @@ def _rgb_to_rgba(A): | |
|
||
|
||
class _ImageBase(martist.Artist, cm.ScalarMappable): | ||
""" | ||
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, | ||
|
@@ -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 | ||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
||
|
@@ -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 | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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).