ANN: matplotlib-0.40 python plots with matlab syntax

John Hunter jdhunter at ace.bsd.uchicago.edu
Mon Dec 15 10:52:59 EST 2003


matplotlib is a pure python 2D plotting library with a matlab syntax
which produces publication quality figures using in a variety of
hardcopy formats (PNG, JPG, TIFF, PS) and interactive GUI environments
(WX, GTK) across platforms.  matplotlib can be used in python scripts,
interactively from the python shell (ala matlab or mathematica), in
web application servers generating dynamic charts, or embedded in GTK
or WX applications.

  http://matplotlib.sourceforge.net

What's new

WX python backend

  Jeremy O'Donoghue has done an amazing job implementing the backend
  for wxpython, with all the features such as interactive navigation
  that are supported in the GTk backend.  matplotlib should not be
  available with a GUI anywhere wxpython, Numeric and python work,
  including linux and friends, win32, and Mac OS X.  See
  http://matplotlib.sourceforge.net/matplotlib.backends.backend_wx.html
  for a summary of known issues.

Pseudo color plots

  The pcolor command generates pseudo color plots.  See
  http://matplotlib.sourceforge.net/screenshots.html#pcolor_demo and
  http://matplotlib.sourceforge.net/screenshots.html#mri_with_eeg for
  screenshots and example code

New time-series plotting functions
  
  * psd - plots the power spectral density of a time series
  * csd - plots the cross spectral density of two time series
  * cohere - plots the coherence

  See the examples dir in the src distro: psd_demo.py and csd_demo.py

Substantially improved layout

  The transform architecture was refactored, allowing much more
  precise layout.  Lines, patches, text, etc... can now be placed and
  scaled in arbitrary units, relative axes units, or physical size.
  Applicaiton programmers who want to create lines, patches and text
  directly using the API should read the transform module docs for
  more info.  See the text help for an example of how to specify text
  locations in axes coords (0,0 is lower left and 1,1 is upper right)

Expanded legend capabilities

  The legend class is improved, with a more sophisticated layout
  engine and the ability to accept lines and rectangle patches as an
  optional first argument to specify which lines/patches make up the
  legend.  There are also additional legend placement locations, like
  'upper center'.  See
  http://matplotlib.sourceforge.net/screenshots.html#legend_demo

Expanded errorbar capabilities

  Gary Ruben contributed some code to support x and y errorbars,
  either symmetrix or asymettric, in one enhanced function 'errorbar'.
  See the errorbar_demo.py for examples of all the wild and wonderful
  errorbar styles.  Bar charts can now also display errorbars; see
  http://matplotlib.sourceforge.net/screenshots.html#barchart_demo

Figure size and DPI controllable from matlab interface

  The figure command now takes optional args figsize and dpi to set
  the figure size and DPI in the matlab interface.  This change
  involved some changes in the way default sizes and resolutions were
  handled among the various backends, with the effect that figures
  generated by existing scripts may appear different, eg, in the
  relative size of text to the figure elements.  The advantage is that
  the current implementation does a better job of computing true sizes
  with increased fidelity between backends.  Apologies for any
  inconveniences!

API changes

  There have been some minor changes to the API for those using
  matplotlib embedded in GTK applications.  

  * If you instantiate an Axes of Subplot intace, the first arg to
    __init__ must be the figure that contains it.

  * If you instantiate any artists, eg, Line2D, Rectangle, or
    AxisTextGTk, you must initialize them with their dpi, bbox, and
    transforms.  See the help for the transforms modules and the
    examples logo.py and mri_with_eeg.py, where the objects are
    explicity created using the new API.

  * The only change to the matlab interface is in the signature of the
    errorbar func, which breaks matlab compatibility for the enhanced
    ability to do x and y errorbars.

  * See matplotlib.axes.py for a complete list of API changes


John Hunter





More information about the Python-list mailing list