| |
- __builtin__.object
-
- BaseFigure(matplotlib.figure.Figure, __builtin__.object)
-
- BaseSpectrumFigure
-
- MultipleSpectraFigure
- SingleMoleculeSpectraFigure
-
- IRVCDCalcFigure
- RamanROADegcircCalcFigure
-
- RamanROADegcircCalcMixtureFigure
- PercentageFigure
- matplotlib.figure.Figure(matplotlib.artist.Artist)
-
- BaseFigure(matplotlib.figure.Figure, __builtin__.object)
-
- BaseSpectrumFigure
-
- MultipleSpectraFigure
- SingleMoleculeSpectraFigure
-
- IRVCDCalcFigure
- RamanROADegcircCalcFigure
-
- RamanROADegcircCalcMixtureFigure
- PercentageFigure
class BaseFigure(matplotlib.figure.Figure, __builtin__.object) |
|
Base class for all figures.
This class defines a set of protected methods which are called in the
constructor in the following sequence :
_init_vars() -- initialize some variables
_declare_properties() -- declare properties of the widget
_bind_events() -- bind events
These methods are intended to be overridden in subclasses. The base class
implementations do *nothing*.
The following protected instance variables are created :
_smartdict -- to store options (pyviblib.util.misc.SmartDict)
_varsdict -- to store GUI variables (dictionary)
The following read-only properties are exposed :
tk_canvas -- Tkinter.Canvas to be used in GUI
settings -- reference to self._smartdict
The following public method is exported :
save() -- save the figure |
|
- Method resolution order:
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
Keyword arguments :
accepts all keywords arguments of the matplotlib.figure.Figure constructor.
- save(self, filename, **kw)
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
dpi -- resolution in dots per inch (default 150).
CompatibilityLevel -- PDF compatibility level (default '1.3')
orientation -- 'landscape' or 'portrait' (default 'portrait').
size -- size in inches to set (default None)
if None, use the current size
restoresize -- restore the current size (default True)
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
|
class BaseSpectrumFigure(BaseFigure) |
|
Template spectrum.
The plotting region is be defined in the class.
The following readable and writable properties are exposed :
canvas_changed -- canvas state
xlim -- region of wavenumbers
The following public methods are exposed :
get_spectra_axes() -- get a reference to spectra axes
restore_last_zoom() -- restore the last plotting region
save() -- save the figure |
|
- Method resolution order:
- BaseSpectrumFigure
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
Keyword arguments :
- get_spectra_axes(self, name)
- Get a reference of an axes.
Positional arguments :
name -- 'axes_%s' % name key should be in the internal dictionary.
- restore_last_zoom(self)
- Restore the last viewing region.
- save(self, filename, size=None, limits='current')
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
size -- size in inches (default None)
if None, keep the current size
limits -- 'default' - 1900-100
'current' - do not change
(default 'current')
Static methods defined here:
- get_representation_as_index(repr_string)
- Get the representation type (0 - curves, 1 - stick).
Data and other attributes defined here:
- EDGECOLOR = 'black'
- FACECOLOR = 'white'
- FIGSIZE_A4 = (7.7637795275590546, 11.185039370078741)
- FIGSIZE_DEFAULT = (7.8740157480314963, 7.0866141732283463)
- HEIGHT_AXES = 0.79000000000000004
- LIM_AVAIL_WAVENUMBERS = (0.0, 10000.0)
- LIM_WAVENUMBERS = (1900.0, 100.0)
- LINEWIDTH = 1.0
- MAX_ZOOMING_INTERVAL = 50.0
- POS_AXES_UNITS = (-0.127, 0.5)
- RECT_BOTTOM = (0.13, 0.089999999999999997, 0.77500000000000002, 0.28000000000000003)
- RECT_BOUNDING = (0.13, 0.089999999999999997, 0.77500000000000002, 0.79000000000000004)
- RECT_MIDDLE = (0.13, 0.40999999999999998, 0.77500000000000002, 0.28000000000000003)
- RECT_TOP = (0.13, 0.72999999999999998, 0.77500000000000002, 0.12)
- TEX_AXIS_WAVENUMBER = r'$Wavenumber,\ [\ cm^{-1}\ ]$'
- THREE_AXES_NAMES = ('bottom', 'middle', 'top')
- WIDTH_AXES = 0.77500000000000002
- XSTART_AXES = 0.13
- YSTART_AXES = 0.089999999999999997
Data and other attributes inherited from BaseFigure:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
|
class IRVCDCalcFigure(SingleMoleculeSpectraFigure) |
|
Calculated IR/VCD/g spectra. |
|
- Method resolution order:
- IRVCDCalcFigure
- SingleMoleculeSpectraFigure
- BaseSpectrumFigure
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, mol, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
mol -- molecule
Keyword arguments :
sync_zoom_figures -- list of figures to synchronize with (default None)
- plot_spectra(self, **kw)
- Plot the spectra.
Keyword arguments :
representation -- 'Curves' or 'Stick' (default 'Curves')
lim_wavenumbers -- (left_nu, right_nu) ; left_nu > right_nu
(default (1900., 100.))
tick_wavenumbers -- major tick (default 200.)
labels_fontsize -- font size of the axes and spectra labels
(default 17)
N_G -- number of Gauss functions for fitting
FWHM_fit -- full width at half maximum for the curves
(default 10.)
FWHM_inst -- full width at half maximum for the
Gaussian instrument profile
(default 10.)
title1 -- Title at the top of the figure (default '')
title2 -- Smaller title beneath the title1 (default '')
Data and other attributes defined here:
- AXES_NAMES = ('ir', 'vcd', 'g')
- TEX_LABEL_DEPSILON = r'$\it{\Delta \varepsilon}$'
- TEX_LABEL_EPSILON = r'$\it{\varepsilon}$'
- TEX_LABEL_G = r'$\it{g} \ \times 10^{%d}$'
- TEX_LABEL_INTDEPSILON = r'$\it{\Delta A}$'
- TEX_LABEL_INTEPSILON = r'$\it{A}$'
- TEX_UNITS_EPSILON = '$%s m^2 / mol$'
- TEX_UNITS_INTEPSILON = '$%s m / mol$'
Methods inherited from BaseSpectrumFigure:
- get_spectra_axes(self, name)
- Get a reference of an axes.
Positional arguments :
name -- 'axes_%s' % name key should be in the internal dictionary.
- restore_last_zoom(self)
- Restore the last viewing region.
- save(self, filename, size=None, limits='current')
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
size -- size in inches (default None)
if None, keep the current size
limits -- 'default' - 1900-100
'current' - do not change
(default 'current')
Static methods inherited from BaseSpectrumFigure:
- get_representation_as_index(repr_string)
- Get the representation type (0 - curves, 1 - stick).
Data and other attributes inherited from BaseSpectrumFigure:
- EDGECOLOR = 'black'
- FACECOLOR = 'white'
- FIGSIZE_A4 = (7.7637795275590546, 11.185039370078741)
- FIGSIZE_DEFAULT = (7.8740157480314963, 7.0866141732283463)
- HEIGHT_AXES = 0.79000000000000004
- LIM_AVAIL_WAVENUMBERS = (0.0, 10000.0)
- LIM_WAVENUMBERS = (1900.0, 100.0)
- LINEWIDTH = 1.0
- MAX_ZOOMING_INTERVAL = 50.0
- POS_AXES_UNITS = (-0.127, 0.5)
- RECT_BOTTOM = (0.13, 0.089999999999999997, 0.77500000000000002, 0.28000000000000003)
- RECT_BOUNDING = (0.13, 0.089999999999999997, 0.77500000000000002, 0.79000000000000004)
- RECT_MIDDLE = (0.13, 0.40999999999999998, 0.77500000000000002, 0.28000000000000003)
- RECT_TOP = (0.13, 0.72999999999999998, 0.77500000000000002, 0.12)
- TEX_AXIS_WAVENUMBER = r'$Wavenumber,\ [\ cm^{-1}\ ]$'
- THREE_AXES_NAMES = ('bottom', 'middle', 'top')
- WIDTH_AXES = 0.77500000000000002
- XSTART_AXES = 0.13
- YSTART_AXES = 0.089999999999999997
Data and other attributes inherited from BaseFigure:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
|
class MultipleSpectraFigure(BaseSpectrumFigure) |
|
Plotting spectra of several molecules.
The following read-only properties are exposed :
ylim -- y limits
multfactor -- order of magnitude of the y values
The following public method is exported :
plot_spectra() -- plot the spectra |
|
- Method resolution order:
- MultipleSpectraFigure
- BaseSpectrumFigure
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, mols, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
mols -- list of molecules
- plot_spectra(self, XY, **kw)
- Plot the spectra.
Positional arguments :
XY -- [ [X1, Y1], ... ]
Keyword arguments :
autoresize -- if True, the size of a single spectrum is
calculated automatically
spectrum_size -- (w, h) in cm, used if autoresize is set to False
label_type -- type of the spectra label :
None - no label
0 - raman
1 - roa
2 - degcirc
data_calc -- True for calculated data, False for experimental
(default True)
molecule_labels -- list of the labels of the subplots
make_degcirc -- apply the axis setting of a degree of circularity
spectrum
mark_vibs -- list of vibrations to be marked
(fit : +-5 for each peak, stick : the vibrations)
normalize_energy -- whether to normalize exp. Raman/ROA to the laser energy
(default True)
accepts all the keyword arguments of
RamanROADegcircCalcFigure.plot_spectra()
Data and other attributes defined here:
- DISTANCE_SPECTRUM = 0.20000000000000001
- X_PEAK_MARK_INTERVAL = 5
- YUPPER_SPECTRUM = 0.88
Methods inherited from BaseSpectrumFigure:
- get_spectra_axes(self, name)
- Get a reference of an axes.
Positional arguments :
name -- 'axes_%s' % name key should be in the internal dictionary.
- restore_last_zoom(self)
- Restore the last viewing region.
- save(self, filename, size=None, limits='current')
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
size -- size in inches (default None)
if None, keep the current size
limits -- 'default' - 1900-100
'current' - do not change
(default 'current')
Static methods inherited from BaseSpectrumFigure:
- get_representation_as_index(repr_string)
- Get the representation type (0 - curves, 1 - stick).
Data and other attributes inherited from BaseSpectrumFigure:
- EDGECOLOR = 'black'
- FACECOLOR = 'white'
- FIGSIZE_A4 = (7.7637795275590546, 11.185039370078741)
- FIGSIZE_DEFAULT = (7.8740157480314963, 7.0866141732283463)
- HEIGHT_AXES = 0.79000000000000004
- LIM_AVAIL_WAVENUMBERS = (0.0, 10000.0)
- LIM_WAVENUMBERS = (1900.0, 100.0)
- LINEWIDTH = 1.0
- MAX_ZOOMING_INTERVAL = 50.0
- POS_AXES_UNITS = (-0.127, 0.5)
- RECT_BOTTOM = (0.13, 0.089999999999999997, 0.77500000000000002, 0.28000000000000003)
- RECT_BOUNDING = (0.13, 0.089999999999999997, 0.77500000000000002, 0.79000000000000004)
- RECT_MIDDLE = (0.13, 0.40999999999999998, 0.77500000000000002, 0.28000000000000003)
- RECT_TOP = (0.13, 0.72999999999999998, 0.77500000000000002, 0.12)
- TEX_AXIS_WAVENUMBER = r'$Wavenumber,\ [\ cm^{-1}\ ]$'
- THREE_AXES_NAMES = ('bottom', 'middle', 'top')
- WIDTH_AXES = 0.77500000000000002
- XSTART_AXES = 0.13
- YSTART_AXES = 0.089999999999999997
Data and other attributes inherited from BaseFigure:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
|
class PercentageFigure(BaseFigure) |
|
Bar chart figure for representing e.g. composition of a mixture. |
|
- Method resolution order:
- PercentageFigure
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, Y, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
Y -- null-based ndarray.
Methods inherited from BaseFigure:
- save(self, filename, **kw)
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
dpi -- resolution in dots per inch (default 150).
CompatibilityLevel -- PDF compatibility level (default '1.3')
orientation -- 'landscape' or 'portrait' (default 'portrait').
size -- size in inches to set (default None)
if None, use the current size
restoresize -- restore the current size (default True)
Data and other attributes inherited from BaseFigure:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
|
class RamanROADegcircCalcFigure(SingleMoleculeSpectraFigure) |
|
Calculated Raman/ROA/Degree of circularity spectra.
If you want to use Arial fonts, install it : apt-get install msttcorefonts
The following public method is exported :
plot_spectra() -- plot the spectra
The following static methods are exported :
get_scattering_as_index() -- get the scattering type
get_tex_spectrum_label() -- get the TeX source for labels
get_tex_spectrum_units() -- get the TeX source for units |
|
- Method resolution order:
- RamanROADegcircCalcFigure
- SingleMoleculeSpectraFigure
- BaseSpectrumFigure
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, mol, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
mol -- molecule
Keyword arguments :
sync_zoom_figures -- list of figures to synchronize with (default None)
- plot_spectra(self, **kw)
- Plot the spectra.
Keyword arguments :
scattering -- resources.STRINGS_SCATTERING_TYPES
(default 'Backward')
representation -- 'Curves' or 'Stick' (default 'Curves')
lim_wavenumbers -- (left_nu, right_nu) ; left_nu > right_nu
(default (1900., 100.))
tick_wavenumbers -- major tick (default 200.)
labels_fontsize -- font size of the axes and spectra labels
(default 17)
N_G -- number of Gauss functions for fitting
FWHM_is -- full width at half maximum for the
isotropic bandwidth (a2, aG)
(default 3.5)
FWHM_anis -- full width at half maximum for the
anisotropic bandwidth (b2, b2G, b2A)
(default 10.)
FWHM_inst -- full width at half maximum for the
Gaussian instrument profile
(default 7.)
title1 -- Title at the top of the figure (default '')
title2 -- Smaller title beneath the title1 (default '')
Static methods defined here:
- get_scattering_as_index(scat_string)
- Get the scattering type as integer.
Positional arguments :
scat_string -- one of resources.STRINGS_SCATTERING_TYPES
- get_tex_spectrum_label(type_, scattering, representation)
- Return the TeX source for the spectra label.
Positional arguments :
type_ -- type of the spectrum : 0(raman), 1(roa), 2(degcirc)
scattering -- scattering as integer
representation -- representation as integer
- get_tex_spectrum_units(representation, multfactor)
- Return the TeX source for the units.
Positional arguments :
representation -- representation as integer
multfactor -- order of magnitude
Data and other attributes defined here:
- AXES_NAMES = ('raman', 'roa', 'degcirc')
- TEX_LABEL_DEGCIRC = r'$\it{^RC(%s)}$'
- TEX_LABEL_RAMANSPECTRUM = r'$\it{^{%s}d\sigma(%s)/d\Omega %s}$'
- TEX_LABEL_ROASPECTRUM = r'$\it{-\Delta ^{%s}d\sigma(%s)/d\Omega %s}$'
- TEX_UNITS_RAMANROASPECTRUM = r'$%s {\angstrom}^2 %s/ sr$'
Methods inherited from BaseSpectrumFigure:
- get_spectra_axes(self, name)
- Get a reference of an axes.
Positional arguments :
name -- 'axes_%s' % name key should be in the internal dictionary.
- restore_last_zoom(self)
- Restore the last viewing region.
- save(self, filename, size=None, limits='current')
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
size -- size in inches (default None)
if None, keep the current size
limits -- 'default' - 1900-100
'current' - do not change
(default 'current')
Static methods inherited from BaseSpectrumFigure:
- get_representation_as_index(repr_string)
- Get the representation type (0 - curves, 1 - stick).
Data and other attributes inherited from BaseSpectrumFigure:
- EDGECOLOR = 'black'
- FACECOLOR = 'white'
- FIGSIZE_A4 = (7.7637795275590546, 11.185039370078741)
- FIGSIZE_DEFAULT = (7.8740157480314963, 7.0866141732283463)
- HEIGHT_AXES = 0.79000000000000004
- LIM_AVAIL_WAVENUMBERS = (0.0, 10000.0)
- LIM_WAVENUMBERS = (1900.0, 100.0)
- LINEWIDTH = 1.0
- MAX_ZOOMING_INTERVAL = 50.0
- POS_AXES_UNITS = (-0.127, 0.5)
- RECT_BOTTOM = (0.13, 0.089999999999999997, 0.77500000000000002, 0.28000000000000003)
- RECT_BOUNDING = (0.13, 0.089999999999999997, 0.77500000000000002, 0.79000000000000004)
- RECT_MIDDLE = (0.13, 0.40999999999999998, 0.77500000000000002, 0.28000000000000003)
- RECT_TOP = (0.13, 0.72999999999999998, 0.77500000000000002, 0.12)
- TEX_AXIS_WAVENUMBER = r'$Wavenumber,\ [\ cm^{-1}\ ]$'
- THREE_AXES_NAMES = ('bottom', 'middle', 'top')
- WIDTH_AXES = 0.77500000000000002
- XSTART_AXES = 0.13
- YSTART_AXES = 0.089999999999999997
Data and other attributes inherited from BaseFigure:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
|
class RamanROADegcircCalcMixtureFigure(RamanROADegcircCalcFigure) |
|
Calculated Raman/ROA/Degree of circularity spectra of a mixture of
molecules.
The following read-only properties are exposed :
XY_data -- X and Y for the single molecules
The following public method is exposed :
plot_spectra() -- plot the spectra |
|
- Method resolution order:
- RamanROADegcircCalcMixtureFigure
- RamanROADegcircCalcFigure
- SingleMoleculeSpectraFigure
- BaseSpectrumFigure
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, mols, composition, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
mols -- list of molecules
composition -- composition of the mixture (null-based ndarray)
Keyword arguments :
sync_zoom_figures -- list of figures to synchronize with (default None)
- plot_spectra(self, **kw)
- Plot the spectra of a mixture of the molecules.
Keyword arguments :
scattering -- resources.STRINGS_SCATTERING_TYPES
(default 'Backward')
representation -- 'Curves' or 'Stick' (default 'Curves')
lim_wavenumbers -- (left_nu, right_nu) ; left_nu > right_nu
(default (1900., 100.))
tick_wavenumbers -- major tick (default 200.)
labels_fontsize -- font size of the axes and spectra labels
(default 17)
N_G -- number of Gauss functions for fitting
FWHM_is -- full width at half maximum for the
isotropic bandwidth (a2, aG)
(default 3.5)
FWHM_anis -- full width at half maximum for the
anisotropic bandwidth (b2, b2G, b2A)
(default 10.)
FWHM_inst -- full width at half maximum for the
Gaussian instrument profile
(default 7.)
title1 -- Title at the top of the figure (default '')
title2 -- Smaller title beneath the title1 (default '')
Static methods inherited from RamanROADegcircCalcFigure:
- get_scattering_as_index(scat_string)
- Get the scattering type as integer.
Positional arguments :
scat_string -- one of resources.STRINGS_SCATTERING_TYPES
- get_tex_spectrum_label(type_, scattering, representation)
- Return the TeX source for the spectra label.
Positional arguments :
type_ -- type of the spectrum : 0(raman), 1(roa), 2(degcirc)
scattering -- scattering as integer
representation -- representation as integer
- get_tex_spectrum_units(representation, multfactor)
- Return the TeX source for the units.
Positional arguments :
representation -- representation as integer
multfactor -- order of magnitude
Data and other attributes inherited from RamanROADegcircCalcFigure:
- AXES_NAMES = ('raman', 'roa', 'degcirc')
- TEX_LABEL_DEGCIRC = r'$\it{^RC(%s)}$'
- TEX_LABEL_RAMANSPECTRUM = r'$\it{^{%s}d\sigma(%s)/d\Omega %s}$'
- TEX_LABEL_ROASPECTRUM = r'$\it{-\Delta ^{%s}d\sigma(%s)/d\Omega %s}$'
- TEX_UNITS_RAMANROASPECTRUM = r'$%s {\angstrom}^2 %s/ sr$'
Methods inherited from BaseSpectrumFigure:
- get_spectra_axes(self, name)
- Get a reference of an axes.
Positional arguments :
name -- 'axes_%s' % name key should be in the internal dictionary.
- restore_last_zoom(self)
- Restore the last viewing region.
- save(self, filename, size=None, limits='current')
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
size -- size in inches (default None)
if None, keep the current size
limits -- 'default' - 1900-100
'current' - do not change
(default 'current')
Static methods inherited from BaseSpectrumFigure:
- get_representation_as_index(repr_string)
- Get the representation type (0 - curves, 1 - stick).
Data and other attributes inherited from BaseSpectrumFigure:
- EDGECOLOR = 'black'
- FACECOLOR = 'white'
- FIGSIZE_A4 = (7.7637795275590546, 11.185039370078741)
- FIGSIZE_DEFAULT = (7.8740157480314963, 7.0866141732283463)
- HEIGHT_AXES = 0.79000000000000004
- LIM_AVAIL_WAVENUMBERS = (0.0, 10000.0)
- LIM_WAVENUMBERS = (1900.0, 100.0)
- LINEWIDTH = 1.0
- MAX_ZOOMING_INTERVAL = 50.0
- POS_AXES_UNITS = (-0.127, 0.5)
- RECT_BOTTOM = (0.13, 0.089999999999999997, 0.77500000000000002, 0.28000000000000003)
- RECT_BOUNDING = (0.13, 0.089999999999999997, 0.77500000000000002, 0.79000000000000004)
- RECT_MIDDLE = (0.13, 0.40999999999999998, 0.77500000000000002, 0.28000000000000003)
- RECT_TOP = (0.13, 0.72999999999999998, 0.77500000000000002, 0.12)
- TEX_AXIS_WAVENUMBER = r'$Wavenumber,\ [\ cm^{-1}\ ]$'
- THREE_AXES_NAMES = ('bottom', 'middle', 'top')
- WIDTH_AXES = 0.77500000000000002
- XSTART_AXES = 0.13
- YSTART_AXES = 0.089999999999999997
Data and other attributes inherited from BaseFigure:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
|
class SingleMoleculeSpectraFigure(BaseSpectrumFigure) |
|
Spectra of a single molecule. The spectra consist of three parts. |
|
- Method resolution order:
- SingleMoleculeSpectraFigure
- BaseSpectrumFigure
- BaseFigure
- matplotlib.figure.Figure
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, master, mol, **kw)
- Constructor of the class.
Positional arguments :
master -- parent widget
mol -- molecule with the normal modes
Accepts all the keyword arguments of the base class.
Methods inherited from BaseSpectrumFigure:
- get_spectra_axes(self, name)
- Get a reference of an axes.
Positional arguments :
name -- 'axes_%s' % name key should be in the internal dictionary.
- restore_last_zoom(self)
- Restore the last viewing region.
- save(self, filename, size=None, limits='current')
- Save the figure.
Positional arguments :
filename -- file name to save to
Keyword arguments :
size -- size in inches (default None)
if None, keep the current size
limits -- 'default' - 1900-100
'current' - do not change
(default 'current')
Static methods inherited from BaseSpectrumFigure:
- get_representation_as_index(repr_string)
- Get the representation type (0 - curves, 1 - stick).
Data and other attributes inherited from BaseSpectrumFigure:
- EDGECOLOR = 'black'
- FACECOLOR = 'white'
- FIGSIZE_A4 = (7.7637795275590546, 11.185039370078741)
- FIGSIZE_DEFAULT = (7.8740157480314963, 7.0866141732283463)
- HEIGHT_AXES = 0.79000000000000004
- LIM_AVAIL_WAVENUMBERS = (0.0, 10000.0)
- LIM_WAVENUMBERS = (1900.0, 100.0)
- LINEWIDTH = 1.0
- MAX_ZOOMING_INTERVAL = 50.0
- POS_AXES_UNITS = (-0.127, 0.5)
- RECT_BOTTOM = (0.13, 0.089999999999999997, 0.77500000000000002, 0.28000000000000003)
- RECT_BOUNDING = (0.13, 0.089999999999999997, 0.77500000000000002, 0.79000000000000004)
- RECT_MIDDLE = (0.13, 0.40999999999999998, 0.77500000000000002, 0.28000000000000003)
- RECT_TOP = (0.13, 0.72999999999999998, 0.77500000000000002, 0.12)
- TEX_AXIS_WAVENUMBER = r'$Wavenumber,\ [\ cm^{-1}\ ]$'
- THREE_AXES_NAMES = ('bottom', 'middle', 'top')
- WIDTH_AXES = 0.77500000000000002
- XSTART_AXES = 0.13
- YSTART_AXES = 0.089999999999999997
Data and other attributes inherited from BaseFigure:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'BaseFigure' objects>
- list of weak references to the object (if defined)
Methods inherited from matplotlib.figure.Figure:
- 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
rect = l,b,w,h
add_axes(rect)
add_axes(rect, frameon=False, axisbg='g')
add_axes(rect, 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 figure, make sure you give them
unique labels:
add_axes(rect, label='axes1')
add_axes(rect, label='axes2')
The Axes instance will be returned
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- add_axobserver(self, func)
- whenever the axes state change, func(self) will be called
- add_subplot(self, *args, **kwargs)
- Add 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
The following kwargs are supported:
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- clear(self)
- Clear the figure
- clf(self)
- Clear the figure
- colorbar(self, mappable, cax=None, **kw)
- Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
Add a colorbar to a plot.
Function signatures:
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax, **kwargs)
The optional arguments mappable and cax may be included in the kwargs;
they are image, ContourSet, etc. to which the colorbar applies, and
the axes object in which the colorbar will be drawn. Defaults are
the current image and a new axes object created next to that image
after resizing the image.
kwargs are in two groups:
axes properties:
fraction = 0.15; fraction of original axes to use for colorbar
pad = 0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and
new image axes
shrink = 1.0; fraction by which to shrink the colorbar
aspect = 20; ratio of long to short dimensions
colorbar properties:
extend='neither', 'both', 'min', 'max'
If not 'neither', make pointed end(s) for out-of-range
values. These are set for a given colormap using the
colormap set_under and set_over methods.
spacing='uniform', 'proportional'
Uniform spacing gives each discrete color the same space;
proportional makes the space proportional to the data interval.
ticks=None, list of ticks, Locator object
If None, ticks are determined automatically from the input.
format=None, format string, Formatter object
If none, the ScalarFormatter is used.
If a format string is given, e.g. '%.3f', that is used.
An alternative Formatter object may be given instead.
drawedges=False, True
If true, draw lines at color boundaries.
The following will probably be useful only in the context of
indexed colors (that is, when the mappable has norm=NoNorm()),
or other unusual circumstances.
boundaries=None or a sequence
values=None or a sequence which must be of length 1 less than the
sequence of boundaries.
For each region delimited by adjacent entries in
boundaries, the color mapped to the corresponding
value in values will be used.
If mappable is a ContourSet, its extend kwarg is included automatically.
Note that the shrink kwarg provides a simple way to keep
a vertical colorbar, for example, from being taller than
the axes of the mappable to which the colorbar is attached;
but it is a manual method requiring some trial and error.
If the colorbar is too tall (or a horizontal colorbar is
too wide) use a smaller value of shrink.
For more precise control, you can manually specify the
positions of the axes objects in which the mappable and
the colorbar are drawn. In this case, do not use any of the
axes properties kwargs.
- colorbar_classic(self, mappable, cax=None, orientation='vertical', tickfmt='%1.1f', cspacing='proportional', clabels=None, drawedges=False, edgewidth=0.5, edgecolor='k')
- Create a colorbar for mappable image
mappable is the cm.ScalarMappable instance that you want the
colorbar to apply to, e.g. an Image as returned by imshow or a
PatchCollection as returned by scatter or pcolor.
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'
cspacing controls how colors are distributed on the colorbar.
if cspacing == 'linear', each color occupies an equal area
on the colorbar, regardless of the contour spacing.
if cspacing == 'proportional' (Default), the area each color
occupies on the the colorbar is proportional to the contour interval.
Only relevant for a Contour image.
clabels can be a sequence containing the
contour levels to be labelled on the colorbar, or None (Default).
If clabels is None, labels for all contour intervals are
displayed. Only relevant for a Contour image.
if drawedges == True, lines are drawn at the edges between
each color on the colorbar. Default False.
edgecolor is the line color delimiting the edges of the colors
on the colorbar (if drawedges == True). Default black ('k')
edgewidth is the width of the lines delimiting the edges of
the colors on the colorbar (if drawedges == True). Default 0.5
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 Renderer instance renderer
- draw_artist(self, a)
- draw artist only -- this is available only after the figure is drawn
- 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
The following kwargs are supported
adjustable: ['box' | 'datalim']
alpha: float
anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']
animated: [True | False]
aspect: ['auto' | 'equal' | aspect_ratio]
autoscale_on: True|False
axis_bgcolor: any matplotlib color - see help(colors)
axis_off: void
axis_on: void
axisbelow: True|False
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
cursor_props: a (float, color) tuple
figure: a Figure instance
frame_on: True|False
label: any string
lod: [True | False]
navigate: True|False
navigate_mode: unknown
picker: [None|float|boolean|callable]
position: len(4) sequence of floats
title: str
transform: a matplotlib.transform transformation instance
visible: [True | False]
xlabel: str
xlim: len(2) sequence of floats
xscale: ['log' | 'linear' ]
xticklabels: sequence of strings
xticks: sequence of floats
ylabel: str
ylim: len(2) sequence of floats
yscale: ['log' | 'linear']
yticklabels: sequence of strings
yticks: sequence of floats
zorder: any number
- get_axes(self)
- get_children(self)
- get a list of artists contained in the figure
- 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_window_extent(self, *args, **kwargs)
- get the figure bounding box in display space; kwargs are void
- 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,
loc can also be an (x,y) tuple in figure coords, which
specifies the lower left of the legend box. figure coords are
(0,0) is the left, bottom of the figure and 1,1 is the right,
top.
The legend instance is returned. The following kwargs are supported:
isaxes=True # whether this is an axes legend
numpoints = 4 # the number of points in the legend line
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
shadow # if True, draw a shadow behind legend
labelsep = 0.005 # the vertical space between the legend entries
handlelen = 0.05 # the length of the legend lines
handletextsep = 0.02 # the space between the legend line and legend text
axespad = 0.02 # the border between the axes and legend edge
- pick(self, mouseevent)
- savefig(self, *args, **kwargs)
- SAVEFIG(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None):
Save the current figure.
fname - the filename to save the current figure to. The
output formats supported depend on the backend being
used. and are deduced by the extension to fname.
Possibilities are eps, jpeg, pdf, png, ps, svg. fname
can also be a file or file-like object - cairo backend
only. dpi - is the resolution in dots per inch. If
None it will default to the value savefig.dpi in the
matplotlibrc file
facecolor and edgecolor are the colors of the figure rectangle
orientation is either 'landscape' or 'portrait' - not supported on
all backends; currently only on postscript output
papertype is is one of 'letter', 'legal', 'executive', 'ledger', 'a0'
through 'a10', or 'b0' through 'b10' - only supported for postscript
output
format - one of 'pdf', 'png', 'ps', 'svg'. It is used to specify the
output when fname is a file or file-like object - cairo
backend only.
- 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, **kwargs)
- 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
- set_size_inches(self, *args, **kwargs)
- set_size_inches(w,h, forward=False)
Set the figure size in inches
Usage: set_size_inches(self, w,h) OR
set_size_inches(self, (w,h) )
optional kwarg forward=True will cause the canvas size to be
automatically updated; eg you can resize the figure window
from the shell
WARNING: forward=True is broken on all backends except GTK*
ACCEPTS: a w,h tuple with w,h in inches
- subplots_adjust(self, *args, **kwargs)
- subplots_adjust(self, left=None, bottom=None, right=None, top=None,
wspace=None, hspace=None)
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None):
Update the SubplotParams with kwargs (defaulting to rc where
None) and update the subplot locations
- 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
kwargs control the Text properties:
alpha: float
animated: [True | False]
backgroundcolor: any matplotlib color
bbox: rectangle prop dict plus key 'pad' which is a pad in points
clip_box: a matplotlib.transform.Bbox instance
clip_on: [True | False]
color: any matplotlib color
family: [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
figure: a matplotlib.figure.Figure instance
fontproperties: a matplotlib.font_manager.FontProperties instance
horizontalalignment or ha: [ 'center' | 'right' | 'left' ]
label: any string
lod: [True | False]
multialignment: ['left' | 'right' | 'center' ]
name or fontname: string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
picker: [None|float|boolean|callable]
position: (x,y)
rotation: [ angle in degrees 'vertical' | 'horizontal'
size or fontsize: [ size in points | relative size eg 'smaller', 'x-large' ]
style or fontstyle: [ 'normal' | 'italic' | 'oblique']
text: string
transform: a matplotlib.transform transformation instance
variant: [ 'normal' | 'small-caps' ]
verticalalignment or va: [ 'center' | 'top' | 'bottom' ]
visible: [True | False]
weight or fontweight: [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
x: float
y: float
zorder: any number
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- 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_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- 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)
- 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_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_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_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
| |