@header@
 
 
matplotlib.image
index
/usr/local/lib/python2.5/site-packages/matplotlib/image.py

The image module supports basic image loading, rescaling and display
operations.

 
Modules
       
matplotlib._image
matplotlib.cm
matplotlib.numerix.ma
matplotlib.numerix
os
sys

 
Classes
       
matplotlib.artist.Artist
AxesImage(matplotlib.artist.Artist, matplotlib.cm.ScalarMappable)
NonUniformImage
FigureImage(matplotlib.artist.Artist, matplotlib.cm.ScalarMappable)
matplotlib.cm.ScalarMappable
AxesImage(matplotlib.artist.Artist, matplotlib.cm.ScalarMappable)
NonUniformImage
FigureImage(matplotlib.artist.Artist, matplotlib.cm.ScalarMappable)

 
class AxesImage(matplotlib.artist.Artist, matplotlib.cm.ScalarMappable)
    
Method resolution order:
AxesImage
matplotlib.artist.Artist
matplotlib.cm.ScalarMappable

Methods defined here:
__init__(self, ax, cmap=None, norm=None, interpolation=None, origin=None, extent=None, filternorm=1, filterrad=4.0, **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
changed(self)
Call this whenever the mappable is changed so observers can
update state
draw(self, renderer, *args, **kwargs)
get_extent(self)
get the image extent: left, right, bottom, top
get_filternorm(self)
return the filternorm setting
get_filterrad(self)
return the filterrad setting
get_interpolation(self)
Return the interpolation method the image uses when resizing.
 
One of
 
'bicubic', 'bilinear', 'blackman100', 'blackman256', 'blackman64',
'nearest', 'sinc144', 'sinc256', 'sinc64', 'spline16', 'spline36'
get_size(self)
Get the numrows, numcols of the input image
make_image(self, magnification=1.0)
pick(self, mouseevent)
return true if the data coords of mouse click are within the extent of the image
set_alpha(self, alpha)
Set the alpha value used for blending - not supported on
all backends
 
ACCEPTS: float
set_array(self, A)
retained for backwards compatibility - use set_data instead
 
ACCEPTS: numeric/numarray/PIL Image A
set_data(self, A, shape=None)
Set the image array
 
ACCEPTS: numpy/PIL Image A
set_filternorm(self, filternorm)
Set whether the resize filter norms the weights -- see
help for imshow
 
ACCEPTS: 0 or 1
set_filterrad(self, filterrad)
Set the resize filter radius only applicable to some
interpolation schemes -- see help for imshow
 
ACCEPTS: positive float
set_interpolation(self, s)
Set the interpolation method the image uses when resizing.
 
ACCEPTS: ['bicubic' | 'bilinear' | 'blackman100' | 'blackman256' | 'blackman64', 'nearest' | 'sinc144' | 'sinc256' | 'sinc64' | 'spline16' | 'spline36']
write_png(self, fname, noscale=False)
Write the image to png file with fname

Methods inherited from matplotlib.artist.Artist:
add_callback(self, func)
convert_xunits(self, x)
for artists in an axes, if the xaxis as units support,
convert x using xaxis unit type
convert_yunits(self, y)
for artists in an axes, if the yaxis as units support,
convert y using yaxis unit type
get_alpha(self)
Return the alpha value used for blending - not supported on all
backends
get_animated(self)
return the artist's animated state
get_axes(self)
return the axes instance the artist resides in, or None
get_clip_box(self)
Return artist clipbox
get_clip_on(self)
Return whether artist uses clipping
get_clip_path(self)
Return artist clip path
get_figure(self)
return the figure instance
get_label(self)
get_picker(self)
return the Pickeration instance used by this artist
get_transform(self)
return the Transformation instance used by this artist
get_visible(self)
return the artist's visiblity
get_zorder(self)
have_units(self)
return True if units are set on the x or y axes
is_figure_set(self)
is_transform_set(self)
Artist has transform explicity let
pchanged(self)
fire event when property changed
pickable(self)
return True if self is pickable
remove_callback(self, oid)
set(self, **kwargs)
A tkstyle set command, pass kwargs to set properties
set_animated(self, b)
set the artist's animation state
 
ACCEPTS: [True | False]
set_axes(self, axes)
set the axes instance the artist resides in, if any
 
ACCEPTS: an axes instance
set_clip_box(self, clipbox)
Set the artist's clip Bbox
 
ACCEPTS: a matplotlib.transform.Bbox instance
set_clip_on(self, b)
Set  whether artist uses clipping
 
ACCEPTS: [True | False]
set_clip_path(self, path)
Set the artist's clip path
 
ACCEPTS: an agg.path_storage instance
set_figure(self, fig)
Set the figure instance the artist belong to
 
ACCEPTS: a matplotlib.figure.Figure instance
set_label(self, s)
Set the line label to s for auto legend
 
ACCEPTS: any string
set_lod(self, on)
Set Level of Detail on or off.  If on, the artists may examine
things like the pixel width of the axes and draw a subset of
their contents accordingly
 
ACCEPTS: [True | False]
set_picker(self, picker)
set the epsilon for picking used by this artist
 
picker can be one of the following:
 
  None -  picking is disabled for this artist (default)
 
  boolean - if True then picking will be enabled and the
    artist will fire a pick event if the mouse event is over
    the artist
 
  float - if picker is a number it is interpreted as an
    epsilon tolerance in points and the the artist will fire
    off an event if it's data is within epsilon of the mouse
    event.  For some artists like lines and patch collections,
    the artist may provide additional data to the pick event
    that is generated, eg the indices of the data within
    epsilon of the pick event
 
  function - if picker is callable, it is a user supplied
    function which determines whether the artist is hit by the
    mouse event.
 
      hit, props = picker(artist, mouseevent)
 
    to determine the hit test.  if the mouse event is over the
    artist, return hit=True and props is a dictionary of
    properties you want added to the PickEvent attributes
 
ACCEPTS: [None|float|boolean|callable]
set_transform(self, t)
set the Transformation instance used by this artist
 
ACCEPTS: a matplotlib.transform transformation instance
set_visible(self, b)
set the artist's visiblity
 
ACCEPTS: [True | False]
set_zorder(self, level)
Set the zorder for the artist
 
ACCEPTS: any number
update(self, props)
update_from(self, other)
copy properties from other to self

Data and other attributes inherited from matplotlib.artist.Artist:
aname = 'Artist'
zorder = 0

Methods inherited from matplotlib.cm.ScalarMappable:
add_observer(self, mappable)
whenever the norm, clim or cmap is set, call the notify
instance of the mappable observer with self.
 
This is designed to allow one image to follow changes in the
cmap of another image
autoscale(self)
Autoscale the scalar limits on the norm instance using the
current array
autoscale_None(self)
Autoscale the scalar limits on the norm instance using the
current array, changing only limits that are None
get_array(self)
Return the array
get_clim(self)
return the min, max of the color limits for image scaling
notify(self, mappable)
If this is called then we are pegged to another mappable.
Update our cmap, norm, alpha from the other mappable.
set_clim(self, vmin=None, vmax=None)
set the norm limits for image scaling; if vmin is a length2
sequence, interpret it as (vmin, vmax) which is used to
support setp
 
ACCEPTS: a length 2 sequence of floats
set_cmap(self, cmap)
set the colormap for luminance data
 
ACCEPTS: a colormap
set_colorbar(self, im, ax)
set the colorbar image and axes associated with mappable
set_norm(self, norm)
set the normalization instance
to_rgba(self, x, alpha=1.0)
Return a normalized rgba array corresponding to x.
If x is already an rgb or rgba array, return it unchanged.

 
class FigureImage(matplotlib.artist.Artist, matplotlib.cm.ScalarMappable)
    
Method resolution order:
FigureImage
matplotlib.artist.Artist
matplotlib.cm.ScalarMappable

Methods defined here:
__init__(self, fig, cmap=None, norm=None, offsetx=0, offsety=0, origin=None)
cmap is a colors.Colormap instance
norm is a colors.Normalize instance to map luminance to 0-1
draw(self, renderer, *args, **kwargs)
get_size(self)
Get the numrows, numcols of the input image
make_image(self, magnification=1.0)
write_png(self, fname)
Write the image to png file with fname

Methods inherited from matplotlib.artist.Artist:
add_callback(self, func)
convert_xunits(self, x)
for artists in an axes, if the xaxis as units support,
convert x using xaxis unit type
convert_yunits(self, y)
for artists in an axes, if the yaxis as units support,
convert y using yaxis unit type
get_alpha(self)
Return the alpha value used for blending - not supported on all
backends
get_animated(self)
return the artist's animated state
get_axes(self)
return the axes instance the artist resides in, or None
get_clip_box(self)
Return artist clipbox
get_clip_on(self)
Return whether artist uses clipping
get_clip_path(self)
Return artist clip path
get_figure(self)
return the figure instance
get_label(self)
get_picker(self)
return the Pickeration instance used by this artist
get_transform(self)
return the Transformation instance used by this artist
get_visible(self)
return the artist's visiblity
get_zorder(self)
have_units(self)
return True if units are set on the x or y axes
is_figure_set(self)
is_transform_set(self)
Artist has transform explicity let
pchanged(self)
fire event when property changed
pick(self, mouseevent)
the user picked location x,y; if this Artist is within picker
"pick epsilon" of x,y fire off a pick event
pickable(self)
return True if self is pickable
remove_callback(self, oid)
set(self, **kwargs)
A tkstyle set command, pass kwargs to set properties
set_alpha(self, alpha)
Set the alpha value used for blending - not supported on
all backends
 
ACCEPTS: float
set_animated(self, b)
set the artist's animation state
 
ACCEPTS: [True | False]
set_axes(self, axes)
set the axes instance the artist resides in, if any
 
ACCEPTS: an axes instance
set_clip_box(self, clipbox)
Set the artist's clip Bbox
 
ACCEPTS: a matplotlib.transform.Bbox instance
set_clip_on(self, b)
Set  whether artist uses clipping
 
ACCEPTS: [True | False]
set_clip_path(self, path)
Set the artist's clip path
 
ACCEPTS: an agg.path_storage instance
set_figure(self, fig)
Set the figure instance the artist belong to
 
ACCEPTS: a matplotlib.figure.Figure instance
set_label(self, s)
Set the line label to s for auto legend
 
ACCEPTS: any string
set_lod(self, on)
Set Level of Detail on or off.  If on, the artists may examine
things like the pixel width of the axes and draw a subset of
their contents accordingly
 
ACCEPTS: [True | False]
set_picker(self, picker)
set the epsilon for picking used by this artist
 
picker can be one of the following:
 
  None -  picking is disabled for this artist (default)
 
  boolean - if True then picking will be enabled and the
    artist will fire a pick event if the mouse event is over
    the artist
 
  float - if picker is a number it is interpreted as an
    epsilon tolerance in points and the the artist will fire
    off an event if it's data is within epsilon of the mouse
    event.  For some artists like lines and patch collections,
    the artist may provide additional data to the pick event
    that is generated, eg the indices of the data within
    epsilon of the pick event
 
  function - if picker is callable, it is a user supplied
    function which determines whether the artist is hit by the
    mouse event.
 
      hit, props = picker(artist, mouseevent)
 
    to determine the hit test.  if the mouse event is over the
    artist, return hit=True and props is a dictionary of
    properties you want added to the PickEvent attributes
 
ACCEPTS: [None|float|boolean|callable]
set_transform(self, t)
set the Transformation instance used by this artist
 
ACCEPTS: a matplotlib.transform transformation instance
set_visible(self, b)
set the artist's visiblity
 
ACCEPTS: [True | False]
set_zorder(self, level)
Set the zorder for the artist
 
ACCEPTS: any number
update(self, props)
update_from(self, other)
copy properties from other to self

Data and other attributes inherited from matplotlib.artist.Artist:
aname = 'Artist'
zorder = 0

Methods inherited from matplotlib.cm.ScalarMappable:
add_observer(self, mappable)
whenever the norm, clim or cmap is set, call the notify
instance of the mappable observer with self.
 
This is designed to allow one image to follow changes in the
cmap of another image
autoscale(self)
Autoscale the scalar limits on the norm instance using the
current array
autoscale_None(self)
Autoscale the scalar limits on the norm instance using the
current array, changing only limits that are None
changed(self)
Call this whenever the mappable is changed so observers can
update state
get_array(self)
Return the array
get_clim(self)
return the min, max of the color limits for image scaling
notify(self, mappable)
If this is called then we are pegged to another mappable.
Update our cmap, norm, alpha from the other mappable.
set_array(self, A)
Set the image array from numeric/numarray A
set_clim(self, vmin=None, vmax=None)
set the norm limits for image scaling; if vmin is a length2
sequence, interpret it as (vmin, vmax) which is used to
support setp
 
ACCEPTS: a length 2 sequence of floats
set_cmap(self, cmap)
set the colormap for luminance data
 
ACCEPTS: a colormap
set_colorbar(self, im, ax)
set the colorbar image and axes associated with mappable
set_norm(self, norm)
set the normalization instance
to_rgba(self, x, alpha=1.0)
Return a normalized rgba array corresponding to x.
If x is already an rgb or rgba array, return it unchanged.

 
class NonUniformImage(AxesImage)
    
Method resolution order:
NonUniformImage
AxesImage
matplotlib.artist.Artist
matplotlib.cm.ScalarMappable

Methods defined here:
__init__(self, ax, cmap=None, norm=None, extent=None)
get_extent(self)
make_image(self, magnification=1.0)
set_array(self, *args)
set_cmap(self, cmap)
set_data(self, x, y, A)
set_filternorm(self, s)
set_filterrad(self, s)
set_interpolation(self, s)
set_norm(self, norm)

Methods inherited from AxesImage:
changed(self)
Call this whenever the mappable is changed so observers can
update state
draw(self, renderer, *args, **kwargs)
get_filternorm(self)
return the filternorm setting
get_filterrad(self)
return the filterrad setting
get_interpolation(self)
Return the interpolation method the image uses when resizing.
 
One of
 
'bicubic', 'bilinear', 'blackman100', 'blackman256', 'blackman64',
'nearest', 'sinc144', 'sinc256', 'sinc64', 'spline16', 'spline36'
get_size(self)
Get the numrows, numcols of the input image
pick(self, mouseevent)
return true if the data coords of mouse click are within the extent of the image
set_alpha(self, alpha)
Set the alpha value used for blending - not supported on
all backends
 
ACCEPTS: float
write_png(self, fname, noscale=False)
Write the image to png file with fname

Methods inherited from matplotlib.artist.Artist:
add_callback(self, func)
convert_xunits(self, x)
for artists in an axes, if the xaxis as units support,
convert x using xaxis unit type
convert_yunits(self, y)
for artists in an axes, if the yaxis as units support,
convert y using yaxis unit type
get_alpha(self)
Return the alpha value used for blending - not supported on all
backends
get_animated(self)
return the artist's animated state
get_axes(self)
return the axes instance the artist resides in, or None
get_clip_box(self)
Return artist clipbox
get_clip_on(self)
Return whether artist uses clipping
get_clip_path(self)
Return artist clip path
get_figure(self)
return the figure instance
get_label(self)
get_picker(self)
return the Pickeration instance used by this artist
get_transform(self)
return the Transformation instance used by this artist
get_visible(self)
return the artist's visiblity
get_zorder(self)
have_units(self)
return True if units are set on the x or y axes
is_figure_set(self)
is_transform_set(self)
Artist has transform explicity let
pchanged(self)
fire event when property changed
pickable(self)
return True if self is pickable
remove_callback(self, oid)
set(self, **kwargs)
A tkstyle set command, pass kwargs to set properties
set_animated(self, b)
set the artist's animation state
 
ACCEPTS: [True | False]
set_axes(self, axes)
set the axes instance the artist resides in, if any
 
ACCEPTS: an axes instance
set_clip_box(self, clipbox)
Set the artist's clip Bbox
 
ACCEPTS: a matplotlib.transform.Bbox instance
set_clip_on(self, b)
Set  whether artist uses clipping
 
ACCEPTS: [True | False]
set_clip_path(self, path)
Set the artist's clip path
 
ACCEPTS: an agg.path_storage instance
set_figure(self, fig)
Set the figure instance the artist belong to
 
ACCEPTS: a matplotlib.figure.Figure instance
set_label(self, s)
Set the line label to s for auto legend
 
ACCEPTS: any string
set_lod(self, on)
Set Level of Detail on or off.  If on, the artists may examine
things like the pixel width of the axes and draw a subset of
their contents accordingly
 
ACCEPTS: [True | False]
set_picker(self, picker)
set the epsilon for picking used by this artist
 
picker can be one of the following:
 
  None -  picking is disabled for this artist (default)
 
  boolean - if True then picking will be enabled and the
    artist will fire a pick event if the mouse event is over
    the artist
 
  float - if picker is a number it is interpreted as an
    epsilon tolerance in points and the the artist will fire
    off an event if it's data is within epsilon of the mouse
    event.  For some artists like lines and patch collections,
    the artist may provide additional data to the pick event
    that is generated, eg the indices of the data within
    epsilon of the pick event
 
  function - if picker is callable, it is a user supplied
    function which determines whether the artist is hit by the
    mouse event.
 
      hit, props = picker(artist, mouseevent)
 
    to determine the hit test.  if the mouse event is over the
    artist, return hit=True and props is a dictionary of
    properties you want added to the PickEvent attributes
 
ACCEPTS: [None|float|boolean|callable]
set_transform(self, t)
set the Transformation instance used by this artist
 
ACCEPTS: a matplotlib.transform transformation instance
set_visible(self, b)
set the artist's visiblity
 
ACCEPTS: [True | False]
set_zorder(self, level)
Set the zorder for the artist
 
ACCEPTS: any number
update(self, props)
update_from(self, other)
copy properties from other to self

Data and other attributes inherited from matplotlib.artist.Artist:
aname = 'Artist'
zorder = 0

Methods inherited from matplotlib.cm.ScalarMappable:
add_observer(self, mappable)
whenever the norm, clim or cmap is set, call the notify
instance of the mappable observer with self.
 
This is designed to allow one image to follow changes in the
cmap of another image
autoscale(self)
Autoscale the scalar limits on the norm instance using the
current array
autoscale_None(self)
Autoscale the scalar limits on the norm instance using the
current array, changing only limits that are None
get_array(self)
Return the array
get_clim(self)
return the min, max of the color limits for image scaling
notify(self, mappable)
If this is called then we are pegged to another mappable.
Update our cmap, norm, alpha from the other mappable.
set_clim(self, vmin=None, vmax=None)
set the norm limits for image scaling; if vmin is a length2
sequence, interpret it as (vmin, vmax) which is used to
support setp
 
ACCEPTS: a length 2 sequence of floats
set_colorbar(self, im, ax)
set the colorbar image and axes associated with mappable
to_rgba(self, x, alpha=1.0)
Return a normalized rgba array corresponding to x.
If x is already an rgb or rgba array, return it unchanged.

 
Functions
       
imread(fname)
return image file in fname as numerix array
 
Return value is a MxNx4 array of 0-1 normalized floats
pil_to_array(pilImage)

 
Data
        Float32 = 'f'
NewAxis = None
UInt8 = 'B'
colorConverter = <matplotlib.colors.ColorConverter instance at 0x8456eec>
division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)
rcParams = {'axes.axisbelow': False, 'axes.edgecolor': 'k', 'axes.facecolor': 'w', 'axes.formatter.limits': (-7, 7), 'axes.grid': False, 'axes.hold': True, 'axes.labelcolor': 'k', 'axes.labelsize': 12, 'axes.linewidth': 1.0, 'axes.titlesize': 14, ...}
@footer@