“UbuntuHelp:MatPlotLibHowTo”的版本间的差异
来自Ubuntu中文
小 |
小 |
||
第17行: | 第17行: | ||
sudo apt-get install build-essential checkinstall | sudo apt-get install build-essential checkinstall | ||
</nowiki></pre> | </nowiki></pre> | ||
− | Read more about compiling things on Ubuntu at CompilingEasyHowTo. | + | Read more about compiling things on Ubuntu at [[UbuntuHelp:CompilingEasyHowTo|CompilingEasyHowTo]]. |
== Building matplotlib == | == Building matplotlib == | ||
Get the latest source (matplotlib-0.86.2.tar.gz as of late January 2006) from matplotlib.sf.net, unpack it, build it and install it. | Get the latest source (matplotlib-0.86.2.tar.gz as of late January 2006) from matplotlib.sf.net, unpack it, build it and install it. |
2007年12月4日 (二) 10:52的最新版本
点击翻译: |
English |
请不要直接编辑翻译本页,本页将定期与来源同步。 |
目录
What is matplotlib
Matplotlib (AKA Pylab) is a cross platform 2d plotting library for Python. Matplotlib is in the universe repository, package name "python-matplotlib". Here's how I compiled and installed it from source before that was so.
Installing dependencies
Matplotlib works with a variety of GUI toolkits and graphical back ends. I was most interested in the GTK and Tk interface and in the AGG back end. For those, install the pygtk and tk -dev packages and their dependancies (breezy has tcl8.4)
sudo apt-get install python-gtk2-dev sudo apt-get install tk8.4-dev tk8.4-doc
Read more about the available backends at [1].
Installing buildtools
Ubuntu does not ship with make or gcc installed by default, and checkinstall seemed like a good idea
sudo apt-get install build-essential checkinstall
Read more about compiling things on Ubuntu at CompilingEasyHowTo.
Building matplotlib
Get the latest source (matplotlib-0.86.2.tar.gz as of late January 2006) from matplotlib.sf.net, unpack it, build it and install it.
tar zxf matplotlib-0.86.2.tar.gz cd matplotlib-0.86.2 python setup.py build sudo checkinstall python setup.py install
Type whatever you like in the various package fields when checkinstall asks. If you're going to share the resulting package with others then try to be accurate, particulary in the license field, so as to not give the wrong impression. checkinstall creates a debian package from what "python setup.py install" installed. You can use that package to remove those files from your system using "dpkg -r matplotlib-0.86.2". Here are two ways to see what's in that package (which is now installed, and a copy of which is in the matplotlib-0.86.2 source directory).
dpkg -L matplotlib-0.86.2 | less dpkg --contents matplotlib-0.86.2_0.86.2-1_i386.deb | less
Using matplotlib
Copy the sample matplotlibrc file from the `matplotlib-0.86.2` directory to `~/.matplotlib/matplotlibrc` I edited matplotlibrc changing the line
numerix : numarray # numpy, Numeric or numarray
to
numerix : Numeric # numpy, Numeric or numarray
since Numeric is already used in other parts of my application. Run some of the examples in `matplotlib-0.86.2/examples` to check that it works. For example
python integral_demo.py
There is a tutorial on the matplotlib home page and a cookbook on the new SciPy wiki.