|
Re: contour error.. [message #47839 is a reply to message #47827] |
Thu, 02 March 2006 16:21  |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <1141344670.948209.136460@j33g2000cwa.googlegroups.com>,
pimpk24@hotmail.com wrote:
> I get this pesky error: "v array must have 2 dimensions" when trying to
> do a simple call to contour
> V= -( ( -C* cos(C * z)/C) / (C/C) ) * exp(-abs(x)/C)
> contour, v, x, z
You need to make x and z 2-D, like this:
x1= -15000.0
x2 = 15000.0
dx = 100.0
nx= floor((x2- x1)/dx)
x= lindgen(nx) * dx + x1
z1=0.0
z2=14000.0
dz=100.0
nz=floor((z2-z1)/dz) + 1L
z =lindgen(nz)*dz + z1
xx = REBIN(x, nx, nz)
zz = REBIN(REFORM(z, 1, nz), nx, nz)
V= -cos(zz/z2)*exp(-abs(xx/x1))
contour, v, x, z
I had to scale zz and xx in order to make something reasonable to plot.
Ken Bowman
|
|
|