129 lines (90 with data), 4.9 kB
@header@
<h2>Installing matplotlib</h2>
matplotlib requires <a href=http://python.org>python 2.2+</a> and <a
href=http://www.pfdubois.com/numpy>Numeric</a> or <a
href=http://www.stsci.edu/resources/software_hardware/numarray>numarray</a>.
If these dependencies are satisfied, just do the usual thing:<p>
<pre>
> python setup.py install
</pre>
Matplotlib is known to work on several linux, win32 and OS X
platforms; it should run anywhere that python and Numeric run.
To get the most out of matplotlib, you will probably want to install
one or more of the additional backends, which provide output to
various GUI and image rendering libraries. Each of these has
different prerequistes and strengths; see <a
href=faq.html#WHICHBACKEND>which backend should I use?</a>. <p>
With the windows installer, the postscript, Agg and TkAgg backends
should work out of the box if you have Numeric/numarray already
installed. For other backends (WX, Paint) and operating systems,
follow the instructions below and on <a href=backends.html>matplotlib
backends</a>.<p>
Note that if you install matplotlib anywhere other than the default
location, you will need to set the MATPLOTLIBDATA environment variable
to point to the install base dir.
<h2>Windows</h2>
If you don't already have python installed, you may want to consider
using the <a href=http://www.enthought.com/python/>enthought
edition</a> of python, which has scipy, Numeric, and wxpython, plus a
lot of other goodies, preinstalled.<p>
If you have Numeric or numarray on your system, matplotlib will work
out of the box on windows. All of the GUI backends run on windows,
but <a href=backends.html#TkAgg>TkAgg</a> is probably the best one to
use since it requires no other libraries and has the best support for
interactive use with the standard python shell. If you are using the
enthought edition of python, the <a href=backends.html#WXAgg>WXAgg
backend</a> will also work out of the box.<p>
The windows installer *.exe on the download page contains all the code
you need to get up and running. But if you want to try the many demos
that come in the matplotlib src distribution, download the zip file
and look in the examples subdir.
<i>Important: There are known conflicts with some of the backends
with some python IDEs such as pycrust, idle. If you want to use
matplotlib from an IDE, please consult the <a
href=backends.html>backends documentation</a> for compatibility
information. You will have the greatest likelihood of success if you
run the examples from the command shell or by double clicking on them,
rather than from an IDE. If you are interactively generating plots,
your best bet is TkAgg from the standard python shell.</i>
<h2>Linux</h2>
The GTK backend was the first and thus arguably most mature backend
and is a great choice for linux. All of the backends, however, run on
linux. To use GTK or GTKAgg, you need to have GNOME 2 and at least
pygtk-1.99.16 installed. Don't assume that because you are running
redhat 9 that you have the latest libs. Redhat 8 and 9 come with the
GNOME2, but you will still need to upgrade to at least pygtk-1.99.16.
The latest version (currently 2.0.0) is recommended. I don't have
specific information about the other linux distributions.</p>
To build all the backends on a binary linux distro such as redhat, you
need to install a number of the devel libs (and whatever dependencies
they require), I suggest
<table>
<tr><td><b>matplotlib core:</b></td><td> zlib, zlib-devel, libpng,
libpng-devel, freetype, freetype-devel, freetype-utils</td>
<tr><td><b>gtk backend</b></td><td>gtk2-devel, gtk+-devel, pygtk2,
glib-devel, pygtk2-devel, gnome-libs-devel, pygtk2-libglade</td>
<tr><td><b>tk backend</b></td><td>tcl, tk, tkinter </td>
</table>
Edit setup.py to configure the backends you want to build and then do
<tt>python setup.py build</tt>.
<h2><a name=Debian>Debian</a></h3>
Vittorio Palmisano <redclay@email.it> maintails the debian packages at
<a href=http://mentors.debian.net>http://mentors.debian.net</a>.
<pre>
Installation:
* add this lines to your /etc/apt/sources.list:
deb http://mentors.debian.net/debian unstable main contrib non-free
deb-src http://mentors.debian.net/debian unstable main contrib non-free
* then run:
# apt-get update
# apt-get install python-matplotlib python-matplotlib-doc
</pre>
<h2><a name=OSX>OS X</a></h2>
All of the backends run on OS X. You will need to install freetype2
via fink or from src. You will also need the base libraries for a
given backend. Eg, if you want to run TkAgg, you will need a python
with Tkinter; if you want to use WxAgg, install wxpython. See <a
href=backends.html>backends</a> for a more comprehensive discussion of
the various backend requirements. Edit setup.py to configure the
backends you want to build and then do <tt>python setup.py build</tt>.
@footer@