Di Li (di@astrosun.tn.cornell.edu) writes:
> My question is quite basic. I am sure someone has figured it out long ago.
> Please give me a clue on this. Thanks!
>
> I have three vectors of numbers, x,y, and z. Although they are regularly
> spaced data points, z=z_i(x_i,y_i) and the distance between x_i and x_i-1 is
> constant, z cannot be used directly by CONTOUR or SURFACE.
>
> The following works:
> Contour, z,x,y,/irregular
> or
> Triangulate, x,y, tr
> Contour, z,x,y,tr
> .
>
> But the following
>
> Triangulate x,y, tr
> Contour,trigird(x,y,z,tr)
> will lose the original coordinate. Say, the x should be [-30,30], but now it
> is [0,50] (how many grid points are there). Other parameter setting like GS,
> Limits, NX, will only affect grid points, but not being able to get back
> original units.
You need to get the vectors that go with the data you
are trying to contour from output keywords to the
TriGrid command. Your code should look more like
this:
Triangulate, x, y, tr
gridData = Trigrid(x, y, z, tr, XGrid=xgrid, YGrid=ygrid)
Contour, gridData, xgrid, ygrid
Cheers,
David
P.S. I looked this up in my book, because I couldn't
remember how to do it either. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Note: This follow-up was e-mailed to the cited author.]
|