Personal tools
You are here: Home Zpydoc API documentation matplotlib

 matplotlib  (0.98.1)

Up one level
matplotlib
This is an object-orient plotting library. A procedural interface is provided by the companion pylab module, which may be imported directly, e.g:: from pylab import * or using ipython:: ipython -pylab For the most part, direct use of the object-oriented library is encouraged when programming rather than working interactively. The exceptions are the pylab commands :func:`~matplotlib.pyplot.figure`, :func:`~matplotlib.pyplot.subplot`, :func:`~matplotlib.backends.backend_qt4agg.show`, and :func:`~pyplot.savefig`, which can greatly simplify scripting. Modules include: :mod:`matplotlib.axes` defines the :class:`~matplotlib.axes.Axes` class. Most pylab commands are wrappers for :class:`~matplotlib.axes.Axes` methods. The axes module is the highest level of OO access to the library. :mod:`matplotlib.figure` defines the :class:`~matplotlib.figure.Figure` class. :mod:`matplotlib.artist` defines the :class:`~matplotlib.artist.Artist` base class for all classes that draw things. :mod:`matplotlib.lines` defines the :class:`~matplotlib.lines.Line2D` class for drawing lines and markers :mod`matplotlib.patches` defines classes for drawing polygons :mod:`matplotlib.text` defines the :class:`~matplotlib.text.Text`, :class:`~matplotlib.text.TextWithDash`, and :class:`~matplotlib.text.Annotate` classes :mod:`matplotlib.image` defines the :class:`~matplotlib.image.AxesImage` and :class:`~matplotlib.image.FigureImage` classes :mod:`matplotlib.collections` classes for efficient drawing of groups of lines or polygons :mod:`matplotlib.colors` classes for interpreting color specifications and for making colormaps :mod:`matplotlib.cm` colormaps and the :class:`~matplotlib.image.ScalarMappable` mixin class for providing color mapping functionality to other classes :mod:`matplotlib.ticker` classes for calculating tick mark locations and for formatting tick labels :mod:`matplotlib.backends` a subpackage with modules for various gui libraries and output formats The base matplotlib namespace includes: :data:`~matplotlib.rcParams` a global dictionary of default configuration settings. It is initialized by code which may be overridded by a matplotlibrc file. :func:`~matplotlib.rc` a function for setting groups of rcParams values :func:`~matplotlib.use` a function for setting the matplotlib backend. If used, this function must be called immediately after importing matplotlib for the first time. In particular, it must be called **before** importing pylab (if pylab is imported). matplotlib is written by John D. Hunter (jdh2358 at gmail.com) and a host of others.
Packages
numpy
Modules
_cm cbook image quiver
_cntr cm legend rcsetup
_image collections lines scale
_mathtext_data colorbar mathtext table
_path colors mlab text
_png contour mpl ticker
_pylab_helpers dates nxutils transforms
afm figure patches units
artist finance path widgets
axes font_manager pylab
axis fontconfig_pattern pyparsing
backend_bases ft2font pyplot
Classes
  class RcParams ( dict )
A dictionary object including validation validating functions are defined and associated with rc parameters in :mod:`matplotlib.rcsetup`
  class Verbose ( )
A class to handle reporting. Set the fileo attribute to any file instance to handle the output. Default is sys.stdout
ge(self, level)
return true if self.level is >= level
report(self, s, level='helpful')
print message s to self.fileo if self.level>=level. Return value indicates whether a message was issued
set_fileo(self, fname)
set_level(self, level)
set the verbosity to one of the Verbose.levels strings
wrap(self, fmt, func, level='helpful', always=True)
return a callable function that wraps func and reports it output through the verbose handler if current verbosity level is higher than level if always is True, the report will occur on every function call; otherwise only on the first time the function is called
Functions
_get_configdir ()
Return the string representing the configuration dir. default is HOME/.matplotlib. you can override this with the MPLCONFIGDIR environment variable
_get_data_path ()
get the path to matplotlib data
_get_data_path_cached ()
_get_home ()
Find user's home directory if possible. Otherwise raise error. :see: http://mail.python.org/pipermail/python-list/2005-February/263921.html
_is_writable_dir (p)
p is a string pointing to a putative writable dir -- return True p is such a string, else False
checkdep_dvipng ()
checkdep_ghostscript ()
checkdep_pdftops ()
checkdep_ps_distiller (s)
checkdep_tex ()
checkdep_usetex (s)
compare_versions (a, b)
return True if a is greater than b
get_backend ()
Returns the current backend
wrapper (*args, **kwargs)
Return the string representing the configuration dir. default is HOME/.matplotlib. you can override this with the MPLCONFIGDIR environment variable
wrapper (*args, **kwargs)
wrapper (*args, **kwargs)
Find user's home directory if possible. Otherwise raise error. :see: http://mail.python.org/pipermail/python-list/2005-February/263921.html
get_py2exe_datafiles ()
interactive (b)
Set interactive mode to boolean b. If b is True, then draw after every plotting command, eg, after xlabel
is_interactive ()
Return true if plot mode is interactive
is_string_like (obj)
matplotlib_fname ()
Return the path to the rc file Search order: * current working dir * environ var MATPLOTLIBRC * HOME/.matplotlib/matplotlibrc * MATPLOTLIBDATA/matplotlibrc
rc (group, **kwargs)
Set the current rc params. Group is the grouping for the rc, eg. for ``lines.linewidth`` the group is ``lines``, for ``axes.facecolor``, the group is ``axes``, and so on. Group may also be a list or tuple of group names, eg. (*xtick*, *ytick*). *kwargs* is a dictionary attribute name/value pairs, eg:: rc('lines', linewidth=2, color='r') sets the current rc params and is equivalent to:: rcParams['lines.linewidth'] = 2 rcParams['lines.color'] = 'r' The following aliases are available to save typing for interactive users: ===== ================= Alias Property ===== ================= 'lw' 'linewidth' 'ls' 'linestyle' 'c' 'color' 'fc' 'facecolor' 'ec' 'edgecolor' 'mew' 'markeredgewidth' 'aa' 'antialiased' ===== ================= Thus you could abbreviate the above rc command as:: rc('lines', lw=2, c='r') Note you can use python's kwargs dictionary facility to store dictionaries of default parameters. Eg, you can customize the font rc as follows:: font = {'family' : 'monospace', 'weight' : 'bold', 'size' : 'larger'} rc('font', **font) # pass in the font dict as kwargs This enables you to easily switch between several configurations. Use :func:`~matplotlib.pyplot.rcdefaults` to restore the default rc params after changes.
rc_params (fail_on_error=False)
Return the default params updated from the values in the rc file
rcdefaults ()
Restore the default rc params - the ones that were created at matplotlib load time.
tk_window_focus ()
Return true if focus maintenance under TkAgg on win32 is on. This currently works only for python.exe and IPython.exe. Both IDLE and Pythonwin.exe fail badly when tk_window_focus is on.
use (arg, warn=True)
Set the matplotlib backend to one of the known backends. The argument is case-insensitive. For the Cairo backend, the argument can have an extension to indicate the type of output. Example: use('cairo.pdf') will specify a default of pdf output generated by Cairo. Note: this function must be called *before* importing pylab for the first time; or, if you are not using pylab, it must be called before importing matplotlib.backends. If warn is True, a warning is issued if you try and callthis after pylab or pyplot have been loaded. In certain black magic use cases, eg pyplot.switch_backends, we are doing the reloading necessary to make the backend switch work (in some cases, eg pure image backends) so one can set warn=False to supporess the warnings
Document Actions
« July 2010 »
July
MoTuWeThFrSaSu
1234
567891011
12131415161718
19202122232425
262728293031
Log in


Forgot your password?
New user?