@header@
 
 
matplotlib.figure
index
/usr/local/lib/python2.3/site-packages/matplotlib/figure.py

 
Modules
       
matplotlib._image
sys

 
Classes
       
matplotlib.artist.Artist
Figure

 
class Figure(matplotlib.artist.Artist)
     Methods defined here:
__init__(self, figsize=None, dpi=None, facecolor=None, edgecolor=None, linewidth=1.0, frameon=True)
paper size is a w,h tuple in inches
DPI is dots per inch
add_axes(self, *args, **kwargs)
Add an a axes with axes rect [left, bottom, width, height] where all
quantities are in fractions of figure width and height.  kwargs are
legal Axes kwargs plus"polar" which sets whether to create a polar axes
 
    add_axes((l,b,w,h))
    add_axes((l,b,w,h), frameon=False, axisbg='g')
    add_axes((l,b,w,h), polar=True)
    add_axes(ax)   # add an Axes instance
 
 
If the figure already has an axes with key *args, *kwargs then it will
simply make that axes current and return it.  If you do not want this
behavior, eg you want to force the creation of a new axes, you must
use a unique set of args and kwargs.  The artist "label" attribute has
been exposed for this purpose.  Eg, if you want two axes that are
otherwise identical to be added to the axes, make sure you give them
unique labels:
 
    add_axes((l,b,w,h), label='1')
    add_axes((l,b,w,h), label='2')
 
The Axes instance will be returned
add_axobserver(self, func)
whenever the axes state change, func(self) will be called
add_subplot(self, *args, **kwargs)
Add an a subplot.  Examples
 
    add_subplot(111)
    add_subplot(212, axisbg='r')  # add subplot with red background
    add_subplot(111, polar=True)  # add a polar subplot
    add_subplot(sub)              # add Subplot instance sub
        
kwargs are legal Axes kwargs plus"polar" which sets whether to create a
polar axes.  The Axes instance will be returned.
 
If the figure already has a subplot with key *args, *kwargs then it will
simply make that subplot current and return it
clear(self)
Clear the figure
clf(self)
Clear the figure
colorbar(self, mappable, tickfmt='%1.1f', cax=None, orientation='vertical')
Create a colorbar for mappable image
 
tickfmt is a format string to format the colorbar ticks
 
cax is a colorbar axes instance in which the colorbar will be
placed.  If None, as default axesd will be created resizing the
current aqxes to make room for it.  If not None, the supplied axes
will be used and the other axes positions will be unchanged.
 
orientation is the colorbar orientation: one of 'vertical' | 'horizontal'
return value is the colorbar axes instance
delaxes(self, a)
remove a from the figure and update the current axes
draw(self, renderer)
Render the figure using RendererGD instance renderer
figimage(self, X, xo=0, yo=0, alpha=1.0, norm=None, cmap=None, vmin=None, vmax=None, origin=None)
FIGIMAGE(X) # add non-resampled array to figure
 
FIGIMAGE(X, xo, yo) # with pixel offsets
 
FIGIMAGE(X, **kwargs) # control interpolation ,scaling, etc
 
Add a nonresampled figure to the figure from array X.  xo and yo are
offsets in pixels
 
X must be a float array
 
    If X is MxN, assume luminance (grayscale)
    If X is MxNx3, assume RGB
    If X is MxNx4, assume RGBA
 
The following kwargs are allowed: 
 
  * cmap is a cm colormap instance, eg cm.jet.  If None, default to
    the rc image.cmap valuex
 
  * norm is a matplotlib.colors.normalize instance; default is
    normalization().  This scales luminance -> 0-1
 
  * vmin and vmax are used to scale a luminance image to 0-1.  If
    either is None, the min and max of the luminance values will be
    used.  Note if you pass a norm instance, the settings for vmin and
    vmax will be ignored.
 
  * alpha = 1.0 : the alpha blending value
 
  * origin is either 'upper' or 'lower', which 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
 
This complements the axes image (Axes.imshow) which will be resampled
to fit the current axes.  If you want a resampled image to fill the
entire figure, you can define an Axes with size [0,1,0,1].
 
A image.FigureImage instance is returned.
gca(self, **kwargs)
Return the current axes, creating one if necessary
get_axes(self)
get_dpi(self)
Return the dpi as a float
get_edgecolor(self)
Get the edge color of the Figure rectangle
get_facecolor(self)
Get the face color of the Figure rectangle
get_figheight(self)
Return the figheight as a float
get_figwidth(self)
Return the figwidth as a float
get_frameon(self)
get the boolean indicating frameon
get_size_inches(self)
get_width_height(self)
return the figure width and height in pixels
hold(self, b=None)
Set the hold state.  If hold is None (default), toggle the
hold state.  Else set the hold state to boolean value b.
 
Eg
hold()      # toggle hold
hold(True)  # hold is on
hold(False) # hold is off
legend(self, handles, labels, loc, **kwargs)
Place a legend in the figure.  Labels are a sequence of
strings, handles is a sequence of line or patch instances, and
loc can be a string or an integer specifying the legend
location
 
USAGE: 
  legend( (line1, line2, line3),
          ('label1', 'label2', 'label3'),
          'upper right')
 
The LOC location codes are
 
  'best' : 0,          (currently not supported, defaults to upper right)
  'upper right'  : 1,  (default)
  'upper left'   : 2,
  'lower left'   : 3,
  'lower right'  : 4,
  'right'        : 5,
  'center left'  : 6,
  'center right' : 7,
  'lower center' : 8,
  'upper center' : 9,
  'center'       : 10,
 
The legend instance is returned
savefig(self, *args, **kwargs)
SAVEFIG(fname, dpi=150, facecolor='w', edgecolor='w',
orientation='portrait'):
 
Save the current figure to filename fname.  dpi is the resolution
in dots per inch.
 
Output file types currently supported are jpeg and png and will be
deduced by the extension to fname
 
facecolor and edgecolor are the colors os the figure rectangle
 
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output.
sca(self, a)
Set the current axes to be a and return a
set_canvas(self, canvas)
Set the canvas the contains the figure
 
ACCEPTS: a FigureCanvas instance
set_dpi(self, val)
Set the dots-per-inch of the figure
 
ACCEPTS: float
set_edgecolor(self, color)
Set the edge color of the Figure rectangle
 
ACCEPTS: any matplotlib color - see help(colors)
set_facecolor(self, color)
Set the face color of the Figure rectangle
 
ACCEPTS: any matplotlib color - see help(colors)
set_figheight(self, val)
Set the height of the figure in inches
 
ACCEPTS: float
set_figsize_inches(self, *args)
Set the figure size in inches
 
Usage: set_figsize_inches(self, w,h)  OR
       set_figsize_inches(self, (w,h) )
 
ACCEPTS: a w,h tuple with w,h in inches
set_figwidth(self, val)
Set the width of the figure in inches
 
ACCEPTS: float
set_frameon(self, b)
Set whether the figure frame (background) is displayed or invisible
 
ACCEPTS: boolean
text(self, x, y, s, *args, **kwargs)
Add text to figure at location x,y (relative 0-1 coords) See
the help for Axis text for the meaning of the other arguments

Methods inherited from matplotlib.artist.Artist:
get_alpha(self)
Return the alpha value used for blending - not supported on all
backends
get_clip_on(self)
Return whether artist uses clipping
get_figure(self)
return the figure instance
get_label(self)
get_transform(self)
return the Transformation instance used by this artist
get_visible(self)
return the artist's visiblity
get_zorder(self)
is_figure_set(self)
is_transform_set(self)
Artist has transform explicity let
set_alpha(self, alpha)
Set the alpha value used for blending - not supported on
all backends
 
ACCEPTS: float
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_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_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

 
Functions
       
Bbox(...)
Bbox(ll, ur)
Point(...)
Point(x, y)
Value(...)
Value(x)
array(...)
array(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode.  If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence.  If copy is zero and sequence is already an array, a reference will be returned.  If savespace is nonzero, the new array will maintain its precision in operations.
figaspect(arr)
Determine the width and height for a figure that would fit array
preserving aspcect ratio.  The figure width, height in inches are
returned.  Be sure to create an axes with equal with and height, eg
 
w, h = figaspect(A)
fig = Figure(figsize=(w,h))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
ax.imshow(A, **kwargs)
 
Thanks to Fernando Perez for this function

 
Data
        rcParams = {'axes.edgecolor': 'black', 'axes.facecolor': 'white', 'axes.grid': False, 'axes.hold': True, 'axes.labelcolor': 'black', 'axes.labelsize': 12.0, 'axes.linewidth': 1.0, 'axes.titlesize': 14.0, 'backend': 'GTKAgg', 'datapath': '/usr/local/share/matplotlib', ...}
@footer@