|
1 |
| -The latest install instructions can be found at |
2 |
| -http://matplotlib.sourceforge.net/installing.html. |
| 1 | +INTRODUCTION |
| 2 | + |
| 3 | + matplotlib requires at a minimum python 2.2+, Numeric or numarray |
| 4 | + and freetype. To get the most out of matplotlib, you will want to |
| 5 | + build some of the optional GUI and image extensions, discussed |
| 6 | + below. Matplotlib is known to work on linux, unix, win32 and OS X |
| 7 | + platforms. |
| 8 | + |
| 9 | +COMPILING |
| 10 | + |
| 11 | + You will need to have recent versions of freetype (>= 2.1.7), libpng |
| 12 | + and zlib installed on your system. If you are using a package |
| 13 | + manager, also make sure the devel versions of these packages are |
| 14 | + also installed (eg freetype-devel). |
| 15 | + |
| 16 | + The top of setup.py contains some flags controlling which backends |
| 17 | + will be built. If you want to use a GUI backend, you will need |
| 18 | + either Tkinter, pygtk or wxpython installed on your system, from src |
| 19 | + or from a package manager including the devel packages. You can |
| 20 | + choose which backends to enable by setting the flags in setup.py, |
| 21 | + but the 'auto' flags will work in most cases, as matplotlib tries to |
| 22 | + find a GUI and build the backend acccordingly. If you know you |
| 23 | + don't want a particular backend or extension, you can set that flag |
| 24 | + to False. |
| 25 | + |
| 26 | + If you have installed prerequisites to nonstandard places and need |
| 27 | + to inform matplotlib where they are, edit setupext.py an add the |
| 28 | + base dirs to the 'basedir' dictionary entry for your sys.platform. |
| 29 | + Eg, if the header to some required library is in |
| 30 | + /some/path/include/somheader.h, put /some/path in the basedir list |
| 31 | + for your platform. |
| 32 | + |
| 33 | + Note, matplotlib works with with Numeric or numarray, but it is |
| 34 | + important that you set NUMERIX in setup.py to the array package you |
| 35 | + typically use, for efficiency reasons. For performace, it is |
| 36 | + critical that the numerix settings in setup.py and in your |
| 37 | + .matplotlibrc file are the same, and are the same as the array |
| 38 | + package you typicaly use. |
| 39 | + |
| 40 | + Note that if you install matplotlib anywhere other than the default |
| 41 | + location, you will need to set the MATPLOTLIBDATA environment |
| 42 | + variable to point to the install base dir. |
| 43 | + |
| 44 | + |
| 45 | +WINDOWS |
| 46 | + |
| 47 | + If you don't already have python installed, you may want to consider |
| 48 | + using the enthought edition of python, which has scipy, Numeric, and |
| 49 | + wxpython, plus a lot of other goodies, preinstalled - |
| 50 | + http://www.enthought.com/python . With the enthought edition of |
| 51 | + python + matplotlib installer, the following backends should work |
| 52 | + out of the box: agg, wx, wxagg, tkagg, ps and svg. |
| 53 | + |
| 54 | + For standard python installations, you will also need to install |
| 55 | + either Numeric or numarray in addition to the matplotlib installer. |
| 56 | + matplotlib provides installers for Numeric and numarray users. It |
| 57 | + is important that you pick the matplotlib installer that corresponds |
| 58 | + to your array package. Ie, if you mostly work with numarray arrays, |
| 59 | + use the matplotlib numarray installer. matplotlib has a 'numerix' |
| 60 | + setting in the matplotlib rc file (which by default resides in |
| 61 | + c:\python23\share\matplotlitb\.matplotlibrc) and you should make |
| 62 | + sure this setting corresponds to your preferred array package. |
| 63 | + |
| 64 | + With a standard python + Numeric/numarray + matplotlib, the |
| 65 | + following backends should work on windows: agg, tkagg, ps, svg. If |
| 66 | + you want others, eg a wx, wxarr, gtk or gtkagg, you'll need to |
| 67 | + install the requisite GUI toolkits. This is fairly easy, as both |
| 68 | + wxpython and pygtk come with windows friendly installers. The |
| 69 | + latter includes an additional requirement of the GTK runtime. |
| 70 | + |
| 71 | + All of the GUI backends run on windows, but TkAgg is probably the |
| 72 | + best for interactive use from the standard python shell or ipython. |
| 73 | + The windows installer (*.exe) on the download page contains all the |
| 74 | + code you need to get up and running. However, there are many |
| 75 | + examples that are not included in the windows installer. If you |
| 76 | + want to try the many demos that come in the matplotlib src |
| 77 | + distribution, download the zip file and look in the examples subdir. |
| 78 | + |
| 79 | + Important: There are known conflicts with some of the backends with |
| 80 | + some python IDEs such as pycrust, idle. If you want to |
| 81 | + use matplotlib from an IDE, please consult |
| 82 | + http://matplotlib.sf.net/backends.html for compatibility |
| 83 | + information. You will have the greatest likelihood of |
| 84 | + success if you run the examples from the command shell or |
| 85 | + by double clicking on them, rather than from an IDE. If |
| 86 | + you are interactively generating plots, your best bet is |
| 87 | + TkAgg from the standard python shell or ipython. |
| 88 | + |
| 89 | +PACKAGE MANAGERS: (rpms, apt, fink) |
| 90 | + |
| 91 | + RPMS |
| 92 | + |
| 93 | + To build all the backends on a binary linux distro such as redhat, |
| 94 | + you need to install a number of the devel libs (and whatever |
| 95 | + dependencies they require), I suggest |
| 96 | + |
| 97 | + matplotlib core: zlib, zlib-devel, libpng, libpng-devel, |
| 98 | + freetype, freetype-devel, freetype-utils |
| 99 | + |
| 100 | + gtk backend: gtk2-devel, gtk+-devel, pygtk2, glib-devel, |
| 101 | + pygtk2-devel, gnome-libs-devel, pygtk2-libglade |
| 102 | + |
| 103 | + tk backend: tcl, tk, tkinter |
| 104 | + |
| 105 | + DEBIAN |
| 106 | + |
| 107 | + Vittorio Palmisano <redclay@email.it> maintails the debian |
| 108 | + packages at http://mentors.debian.net |
| 109 | + |
| 110 | + |
| 111 | + * add this lines to your /etc/apt/sources.list: deb |
| 112 | + http://mentors.debian.net/debian unstable main contrib |
| 113 | + non-free deb-src http://mentors.debian.net/debian unstable |
| 114 | + main contrib non-free |
| 115 | + |
| 116 | + * then run: |
| 117 | + # apt-get update |
| 118 | + # apt-get install python-matplotlib python-matplotlib-doc |
| 119 | + |
| 120 | + OS X |
| 121 | + |
| 122 | + All of the backends run on OS X. You will need to install |
| 123 | + freetype2, libpng and zlib via fink or from src. You will also |
| 124 | + need the base libraries for a given backend. Eg, if you want to |
| 125 | + run TkAgg, you will need a python with Tkinter; if you want to use |
| 126 | + WxAgg, install wxpython. See |
| 127 | + http://matplotlib.sf.net/backends.html for a more comprehensive |
| 128 | + discussion of the various backend requirements. Edit setup.py to |
| 129 | + configure the backends you want to build as described above. |
| 130 | + |
| 131 | + |
| 132 | + FINK |
| 133 | + |
| 134 | + fink users should use Jeffrey Whitaker's fink distribution, which |
| 135 | + supports the GTK, TkAgg, GTKAgg, PS, WX, WXAgg and Agg backends. |
| 136 | + http://fink.sourceforge.net/pdb/package.php/matplotlib-py23 |
| 137 | + |
| 138 | + |
3 | 139 |
|
4 |
| -The backend specific requirements (eg, for GTK, GD, PS or WX) can be |
5 |
| -found at http://matplotlib.sourceforge.net/backends.html |
|
0 commit comments