On 25/11/2007, Rich Shepard <[EMAIL PROTECTED]> wrote: > On Sat, 24 Nov 2007, Angus McMorland wrote: > > > Great. Hopefully this correction will make things even more clear. > > While the functions and equations are now clear, I get an error that was > present in matplotlib-0.87, but which should be fixed in -0.90.1: > > Traceback (most recent call last): > File "normal-curve.py", line 19, in ? > G = gauss1d(x, fwhm, center) > File "normal-curve.py", line 16, in gauss1d > return exp(-(r-center)**2 / fwhm2k(fwhm)**2) > TypeError: only length-1 arrays can be converted to Python scalars > > According to /usr/lib/python2.4/site-packages/numpy/version.py, the > installed version is 1.0b5. > > Do I have a version incompatibility here?
I'm not completely sure, but I suspect that this is an implementation bug, rather than a version bug, particularly because the line in question isn't involving matplotlib at all. If you post the relevant code (normal-curve.py, by the looks of things), it might be easy to spot the problem. I've found it easiest to solve these sorts of bugs by running the code in an ipython shell, with automatic pdb calling. That way you can inspect the values of the parameters in question - one of which is, I think, the problem here. Angus. -- AJC McMorland, PhD Student Physiology, University of Auckland ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users