<divid="unreleased-message"> You are reading an old version of the documentation (v1.5.0). For the latest version see <ahref="https://matplotlib.org/stable/api/image_api.html">https://matplotlib.org/stable/api/image_api.html</a></div>
<codeclass="descname">get_cursor_data</code><spanclass="sig-paren">(</span><em>event</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.AxesImage.get_cursor_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the cursor data for a given event</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.AxesImage.get_extent">
<codeclass="descname">get_extent</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.AxesImage.get_extent" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the image extent: left, right, bottom, top</p>
<codeclass="descname">get_window_extent</code><spanclass="sig-paren">(</span><em>renderer=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.AxesImage.get_window_extent" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.AxesImage.make_image">
<codeclass="descname">make_image</code><spanclass="sig-paren">(</span><em>magnification=1.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.AxesImage.make_image" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.AxesImage.set_extent">
<codeclass="descname">set_extent</code><spanclass="sig-paren">(</span><em>extent</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.AxesImage.set_extent" title="Permalink to this definition">¶</a></dt>
<dd><p>extent is data axes (left, right, bottom, top) for making image plots</p>
<p>This updates ax.dataLim, and, if autoscaling, sets viewLim
to tightly fit the image, regardless of dataLim. Autoscaling
state is not changed, so following this with ax.autoscale_view
will redo the autoscaling in accord with dataLim.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.image.BboxImage">
<emclass="property">class </em><codeclass="descclassname">matplotlib.image.</code><codeclass="descname">BboxImage</code><spanclass="sig-paren">(</span><em>bbox</em>, <em>cmap=None</em>, <em>norm=None</em>, <em>interpolation=None</em>, <em>origin=None</em>, <em>filternorm=1</em>, <em>filterrad=4.0</em>, <em>resample=False</em>, <em>interp_at_native=True</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.BboxImage" title="Permalink to this definition">¶</a></dt>
<p>The Image class whose size is determined by the given bbox.</p>
<p>cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1</p>
<p>interp_at_native is a flag that determines whether or not
interpolation should still be applied when the image is
displayed at its native resolution. A common use case for this
is when displaying an image for annotational purposes; it is
treated similarly to Photoshop (interpolation is only used when
displaying the image at non-native resolutions).</p>
<p>kwargs are an optional list of Artist keyword args</p>
<dlclass="method">
<dtid="matplotlib.image.BboxImage.contains">
<codeclass="descname">contains</code><spanclass="sig-paren">(</span><em>mouseevent</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.BboxImage.contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Test whether the mouse event occured within the image.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.BboxImage.draw">
<codeclass="descname">draw</code><spanclass="sig-paren">(</span><em>artist</em>, <em>renderer</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.BboxImage.draw" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.BboxImage.get_size">
<codeclass="descname">get_size</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.BboxImage.get_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the numrows, numcols of the input image</p>
<codeclass="descname">get_window_extent</code><spanclass="sig-paren">(</span><em>renderer=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.BboxImage.get_window_extent" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.BboxImage.make_image">
<codeclass="descname">make_image</code><spanclass="sig-paren">(</span><em>renderer</em>, <em>magnification=1.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.BboxImage.make_image" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.image.FigureImage">
<emclass="property">class </em><codeclass="descclassname">matplotlib.image.</code><codeclass="descname">FigureImage</code><spanclass="sig-paren">(</span><em>fig</em>, <em>cmap=None</em>, <em>norm=None</em>, <em>offsetx=0</em>, <em>offsety=0</em>, <em>origin=None</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage" title="Permalink to this definition">¶</a></dt>
norm is a colors.Normalize instance to map luminance to 0-1</p>
<p>kwargs are an optional list of Artist keyword args</p>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.contains">
<codeclass="descname">contains</code><spanclass="sig-paren">(</span><em>mouseevent</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Test whether the mouse event occured within the image.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.draw">
<codeclass="descname">draw</code><spanclass="sig-paren">(</span><em>artist</em>, <em>renderer</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.draw" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.get_extent">
<codeclass="descname">get_extent</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.get_extent" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the image extent: left, right, bottom, top</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.get_size">
<codeclass="descname">get_size</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.get_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the numrows, numcols of the input image</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.make_image">
<codeclass="descname">make_image</code><spanclass="sig-paren">(</span><em>magnification=1.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.make_image" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.set_array">
<codeclass="descname">set_array</code><spanclass="sig-paren">(</span><em>A</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.set_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Deprecated; use set_data for consistency with other image types.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.set_data">
<codeclass="descname">set_data</code><spanclass="sig-paren">(</span><em>A</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.set_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the image array.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.FigureImage.write_png">
<codeclass="descname">write_png</code><spanclass="sig-paren">(</span><em>fname</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.FigureImage.write_png" title="Permalink to this definition">¶</a></dt>
<dd><p>Write the image to png file with fname</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.image.FigureImage.zorder">
<codeclass="descname">zorder</code><emclass="property"> = 0</em><aclass="headerlink" href="#matplotlib.image.FigureImage.zorder" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.image.NonUniformImage">
<emclass="property">class </em><codeclass="descclassname">matplotlib.image.</code><codeclass="descname">NonUniformImage</code><spanclass="sig-paren">(</span><em>ax</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_extent</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.get_extent" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">make_image</code><spanclass="sig-paren">(</span><em>magnification=1.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.make_image" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_array</code><spanclass="sig-paren">(</span><em>*args</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.set_array" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_cmap</code><spanclass="sig-paren">(</span><em>cmap</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.set_cmap" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_data</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>A</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.set_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the grid for the pixel centers, and the pixel values.</p>
<blockquote>
<div><dlclass="docutils">
<dt><em>x</em> and <em>y</em> are 1-D ndarrays of lengths N and M, respectively,</dt>
<dd>specifying pixel centers</dd>
<dt><em>A</em> is an (M,N) ndarray or masked array of values to be</dt>
<dd>colormapped, or a (M,N,3) RGB array, or a (M,N,4) RGBA
<codeclass="descname">set_filternorm</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.set_filternorm" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_filterrad</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.set_filterrad" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_interpolation</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.set_interpolation" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_norm</code><spanclass="sig-paren">(</span><em>norm</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.NonUniformImage.set_norm" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.image.PcolorImage">
<emclass="property">class </em><codeclass="descclassname">matplotlib.image.</code><codeclass="descname">PcolorImage</code><spanclass="sig-paren">(</span><em>ax</em>, <em>x=None</em>, <em>y=None</em>, <em>A=None</em>, <em>cmap=None</em>, <em>norm=None</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.PcolorImage" title="Permalink to this definition">¶</a></dt>
<p>Make a pcolor-style plot with an irregular rectangular grid.</p>
<p>This uses a variation of the original irregular image code,
and it is used by pcolorfast for the corresponding grid type.</p>
<p>cmap defaults to its rc setting</p>
<p>cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1</p>
<p>Additional kwargs are matplotlib.artist properties</p>
<dlclass="method">
<dtid="matplotlib.image.PcolorImage.changed">
<codeclass="descname">changed</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.PcolorImage.changed" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.PcolorImage.draw">
<codeclass="descname">draw</code><spanclass="sig-paren">(</span><em>artist</em>, <em>renderer</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.PcolorImage.draw" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.PcolorImage.make_image">
<codeclass="descname">make_image</code><spanclass="sig-paren">(</span><em>magnification=1.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.PcolorImage.make_image" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.PcolorImage.set_alpha">
<codeclass="descname">set_alpha</code><spanclass="sig-paren">(</span><em>alpha</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.PcolorImage.set_alpha" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the alpha value used for blending - not supported on
all backends</p>
<p>ACCEPTS: float</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.image.PcolorImage.set_array">
<codeclass="descname">set_array</code><spanclass="sig-paren">(</span><em>*args</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.PcolorImage.set_array" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.image.PcolorImage.set_data">
<codeclass="descname">set_data</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>A</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.PcolorImage.set_data" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.image.imread">
<codeclass="descclassname">matplotlib.image.</code><codeclass="descname">imread</code><spanclass="sig-paren">(</span><em>fname</em>, <em>format=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.imread" title="Permalink to this definition">¶</a></dt>
<dd><p>Read an image from a file into an array.</p>
<p><em>fname</em> may be a string path, a valid URL, or a Python
file-like object. If using a file object, it must be opened in binary
mode.</p>
<p>If <em>format</em> is provided, will try to read file of that type,
otherwise the format is deduced from the filename. If nothing can
be deduced, PNG is tried.</p>
<p>Return value is a <codeclass="xref py py-class docutils literal"><spanclass="pre">numpy.array</span></code>. For grayscale images, the
return array is MxN. For RGB images, the return value is MxNx3.
For RGBA images the return value is MxNx4.</p>
<p>matplotlib can only read PNGs natively, but if <aclass="reference external" href="http://www.pythonware.com/products/pil/">PIL</a> is installed, it will
use it to load the image and return an array (if possible) which
can be used with <aclass="reference internal" href="pyplot_api.html#matplotlib.pyplot.imshow" title="matplotlib.pyplot.imshow"><codeclass="xref py py-func docutils literal"><spanclass="pre">imshow()</span></code></a>. Note, URL strings
may not be compatible with PIL. Check the PIL documentation for more
information.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.image.imsave">
<codeclass="descclassname">matplotlib.image.</code><codeclass="descname">imsave</code><spanclass="sig-paren">(</span><em>fname</em>, <em>arr</em>, <em>vmin=None</em>, <em>vmax=None</em>, <em>cmap=None</em>, <em>format=None</em>, <em>origin=None</em>, <em>dpi=100</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.imsave" title="Permalink to this definition">¶</a></dt>
<dd><p>Save an array as in image file.</p>
<p>The output formats available depend on the backend being used.</p>
<dlclass="docutils">
<dt>Arguments:</dt>
<dd><dlclass="first last docutils">
<dt><em>fname</em>:</dt>
<dd>A string containing a path to a filename, or a Python file-like object.
If <em>format</em> is <em>None</em> and <em>fname</em> is a string, the output
format is deduced from the extension of the filename.</dd>
<dt><em>arr</em>:</dt>
<dd>An MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA) array.</dd>
<dd><em>vmin</em> and <em>vmax</em> set the color scaling for the image by fixing the
values that map to the colormap color limits. If either <em>vmin</em>
or <em>vmax</em> is None, that limit is determined from the <em>arr</em>
min/max value.</dd>
<dt><em>cmap</em>:</dt>
<dd>cmap is a colors.Colormap instance, e.g., cm.jet.
If None, default to the rc image.cmap value.</dd>
<dt><em>format</em>:</dt>
<dd>One of the file extensions supported by the active
backend. Most backends support png, pdf, ps, eps and svg.</dd>
<dt><em>origin</em></dt>
<dd>[ ‘upper’ | ‘lower’ ] Indicates where the [0,0] index of
the array is in the upper left or lower left corner of
the axes. Defaults to the rc image.origin value.</dd>
<dt><em>dpi</em></dt>
<dd>The DPI to store in the metadata of the file. This does not affect the
resolution of the output image.</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.image.pil_to_array">
<codeclass="descclassname">matplotlib.image.</code><codeclass="descname">pil_to_array</code><spanclass="sig-paren">(</span><em>pilImage</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.pil_to_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Load a PIL image and return it as a numpy array. For grayscale
images, the return array is MxN. For RGB images, the return value
is MxNx3. For RGBA images the return value is MxNx4</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.image.thumbnail">
<codeclass="descclassname">matplotlib.image.</code><codeclass="descname">thumbnail</code><spanclass="sig-paren">(</span><em>infile</em>, <em>thumbfile</em>, <em>scale=0.1</em>, <em>interpolation='bilinear'</em>, <em>preview=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.image.thumbnail" title="Permalink to this definition">¶</a></dt>
<dd><p>make a thumbnail of image in <em>infile</em> with output filename
<em>thumbfile</em>.</p>
<blockquote>
<div><dlclass="docutils">
<dt><em>infile</em> the image file – must be PNG or Pillow-readable if you</dt>
<dd>the interpolation scheme used in the resampling</dd>
<dt><em>preview</em></dt>
<dd>if True, the default backend (presumably a user interface
backend) will be used which will cause a figure to be raised
if <aclass="reference internal" href="pyplot_api.html#matplotlib.pyplot.show" title="matplotlib.pyplot.show"><codeclass="xref py py-func docutils literal"><spanclass="pre">show()</span></code></a> is called. If it is False,
a pure image backend will be used depending on the extension,
<aclass="reference internal" href="../examples/misc/image_thumbnail.html#misc-image-thumbnail"><span>misc example code: image_thumbnail.py</span></a><p>Return value is the figure instance containing the thumbnail</p>