scatter plot onto background image

Hi He

2008/2/10 He Jibo <hejibo@...287...>:

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/", 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/", 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?


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

Broadcasting explained: