LWN.net Logo

Matplotlib - Data Plotting in Python

Matplotlib is an easy to use plotting library with the capability of generating a wide variety of data plots.

matplotlib is a python 2D plotting library which produces publication quality figures using in a variety of hardcopy formats and interactive GUI environments 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 GUI applications.

[Matplotlib] Matplotlib supports a wide variety of plotting commands; the pylab interface can be used for those who already know Matlab, a popular commercial mathematical application.

A comprehensive tutorial is available for educational purposes and the screenshots page has numerous examples of matplotlib in action, including example code for each plot. The FAQ document contains additional usage information. Matplotlib lives up to its claim of being easy to use, just a few lines of code are all that is required to produce professional looking output.

Installation of matplotlib is fairly straightforward, your editor had no problem making it work on an older Red Hat 9 system, the Fedora Core 3 installation is still proving to be somewhat tricky due to dependency issues. Matplotlib requires Numerical Python (now called Numarray), which in turn requires several additional libraries.

Version 0.71 of Matplotlib was announced this week. The changes include:

  • The numerix module has been reorganized to improve namespace issues.
  • Contours now use the default colormap.
  • The colorbar system now works with arbitrary axes.
  • New accents are available in the mathtext command.
  • Numerous bugs have been fixed.
  • Other minor enhancements are included.
See the what's new document for more details on this release.

If you are looking for a fairly straightforward way to generate automated or manually created data plots, Matplotlib is worth investigating. The source code is available for download here.


(Log in to post comments)

Matplotlib - Data Plotting in Python

Posted Jan 27, 2005 15:51 UTC (Thu) by vmole (guest, #111) [Link]

...Matlab, a commercial plotting package.

Uh, no. Matlab is a complete numerical computation and analysis tool, Yes, it does plotting, but it's hardly "a plotting package". (The free tool Octave is roughly equivalent, although last I knew its plotting was the one thing that was significantly different.

Matplotlib - Data Plotting in Python

Posted Jan 27, 2005 18:01 UTC (Thu) by cook (subscriber, #4) [Link]

>Matlab is a complete numerical computation and analysis tool, Yes, it does plotting, but it's hardly "a plotting package".

The reference has been corrected.

Matplotlib - Data Plotting in Python

Posted Jan 27, 2005 21:43 UTC (Thu) by bronson (subscriber, #4806) [Link]

From the screenshots, this plotting package looks phenomenal. It should give ol' Gnuplot a run for its money.

Can anybody provide a brief comparison of the two?

Matplotlib - Data Plotting in Python

Posted Jan 29, 2005 13:35 UTC (Sat) by oak (guest, #2786) [Link]

Ploticus seems also pretty nice: http://ploticus.sf.net/

Matplotlib - Data Plotting in Python

Posted Jan 28, 2005 23:15 UTC (Fri) by umesh (guest, #3692) [Link]

I have used both GnuPlot and Matplotlib. Both have different purpose. If I want to create a plot from a Python Program using available data, function, etc. I will use Matplotlib. For creating simple plot from my test data, I continue to use GnuPlot.

I find both useful in different ways.

Matplotlib - Data Plotting in Python

Posted Feb 6, 2005 1:00 UTC (Sun) by jjlee (guest, #27707) [Link]

Contrary to what the article says, Numarray and Numerical Python are in fact two distinct libraries (sadly). Numarray is a rewrite of Numerical Python. Numerical Python is still in use, for example in the SciPy project. They each have different performance characteristics.

Numerical Python is also known as Numpy, or Numeric.

Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds