PyLab & SciPy

Every time I go back to trying out Matplotlib and SciPy, I have to re-learn everything. Part of the problem is that the versions there are different names for SciPy:
  • Numeric (pdf) - it no longer being supported, but is required for Matplotlib (or an least I couldn't get it to work with numpy on Linux or Windows). Also, it appears that some programs on Linux that I have installed use Numeric, so I can't uninstall it. To make things even more complicated, the PDF version SciPy documentation is for $$ only, so they point you to the Numeric pdf for documentation.
  • Numarray which is as far as I can see a faster version of Numeric made by the Space Telescope Science Institute. I believe there was a split between Numeric and Numarray because of the speed difference (Numeric is faster for small arrays and Numarray is faster for large arrays). The SciPy page claims that numarray will merge with scipy sometime in the future.
  • NumPy is supposed to be the new numeric. If you look at the link it's http://numeric.scipy.org/ which confuses things some more. SciPy requires NumPy to work and isn't included in the SciPy package.
  • SciPy is a package which has more math functions and requires NumPy to run. In fact for a little project I'm doing for my wife, I need this package.
So in the end I needed to install Numeric, NumPy and SciPy.

For drawing the graphs I was thinking of using ReportLab and outputting to PDF. ReportLab is great, but for graphs with lots of points it takes too long and I have to remember to close the Acrobat window each time - and then Acrobat is too slow displaying these graphs!
So now I'm back to using Matplotlib. It's makes very nice graphs and does subpixel smoothing with the Anti-Grain Geometry library. It's supposed to work with SciPy, but I can't get it to work, so I'm using it with the old Numeric package, which does work. Basically, in my ~/.matplotlib/matplotlibrc file I've put "numerix : Numeric". To further confuse things, to use matplotlib you have to "import pylab".
Both matplotlib and SciPy borrow heavily from the for-pay program called matlab. This is good because if I can find a matlab program that does what I want, it's a pretty straightforward port to making it work with PyLab and SciPy. And PyLab and SciPy are not only free and open source, but are written in Python.
P.S.
You should checkout the interesting page on getting perfect results with the bezier curve in the Anti-Grain Geometry site. It's full of C++ code and pretty pictures.

Comments

Popular posts from this blog

Shortest Sudoku solver in Python

Downloading projecteuler.net