Plot array of arrays

Hello,

I have been struggling with this all afternoon. I have a function which
generates an array of arrays:

y=[array([<f(x0)>]),array([<f(x1)>]),array([<f(x2)>])...]
and x=array([x0,x1,x2,...])

I want to plot the family of curves y=f(x).
plot(x,y[n]) where n is the nth array in y plots the correct curve,
however plot(x,y) and plot(x,y[:]) complain about mismatched array
dimensions.

Any suggestions?
Thanks,
Dave
- –
David D. Clark
Electrical Engineer
P-23, Neutron Science and Technology
e-mail mailto:ddclark@…652…
GPG Public key 0x018D6523 available at http://pgp.mit.edu
http://www.gnupg.org has information about public key cryptography

Might you want
plot(x,y.transpose())

hth,
Alan Isaac

···

On Mon, 01 Oct 2007, David D Clark apparently wrote:

y=[array([<f(x0)>]),array([<f(x1)>]),array([<f(x2)>])...]
and x=array([x0,x1,x2,...])

I want to plot the family of curves y=f(x).
plot(x,y[n]) where n is the nth array in y plots the correct curve,
however plot(x,y) and plot(x,y[:]) complain about mismatched array
dimensions.

Alan,

Thanks for the help. This was a big clue. It turns out that what I
thought was an array of arrays was actually a list of arrays. If my
list was y, running plot(x,array(y).transpose()) solved the problem!

Thanks for your help,
Dave

Alan G Isaac wrote:

y=[array([<f(x0)>]),array([<f(x1)>]),array([<f(x2)>])...]
and x=array([x0,x1,x2,...])

I want to plot the family of curves y=f(x).
plot(x,y[n]) where n is the nth array in y plots the correct curve,
however plot(x,y) and plot(x,y[:]) complain about mismatched array
dimensions.

Might you want
plot(x,y.transpose())

hth,
Alan Isaac

-------------------------------------------------------------------------
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

- –
David D. Clark
Electrical Engineer
P-23, Neutron Science and Technology
e-mail mailto:ddclark@…652…
GPG Public key 0x018D6523 available at http://pgp.mit.edu
http://www.gnupg.org has information about public key cryptography

···

On Mon, 01 Oct 2007, David D Clark apparently wrote: