Hi He

2008/2/10 He Jibo <[EMAIL PROTECTED]>:
> Hi, Arnar,
>
> Thank you for your great help!This is what I need! But this code has some
> warnings, could you please help me debug it? Thank you !
>
> the first error is :
> Traceback (most recent call last):
>   File "D:/Program Files/python 2.4.3/py2exe
> code/fixation_distribution_background.py", line 10, in -toplevel-
>
>     xy = p.loadtxt(xy_fn)
> AttributeError: 'module' object has no attribute 'loadtxt'

loadtxt is from the numpy interface, so I assume you are not using a
version of matplotlib with numpy. load() should do the job as well.
The point is to get an array (xy) of shape (n_points x 2), see below.

> I guess 'loadtxt' should be 'load'. After I changed this, another error
> came. It is:
>
> Traceback (most recent call last):
>   File "D:/Program Files/python 2.4.3/py2exe
> code/fixation_distribution_background.py", line 11, in -toplevel-
>     xy_normed = xy/[[1024./im.shape[1], 768./im.shape[0]]]
>  ValueError: shape mismatch: objects cannot be broadcast to a single shape

If the array xy has shape (8,2) this broadcast should be fine. Again,
this could be an issue with your version of Numeric/Numarray/(old
numpy). I dont know these old libraries well enough to say for sure. I
think at least Numeric uses same type of broadcasting as numpy.

So, what kind of numeric library are you using and what is the shape
of xy after you have loaded the fixation-textfile?


Arnar

PS:
For reference my versions are as follows:
numpy.__version__   :  '1.0.5.dev'
matplotlib.__version__  : '0.91.2'

Broadcasting explained: http://www.scipy.org/EricsBroadcastingDoc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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

Reply via email to