comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: plot (x,y,z) triplets as a surface?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: plot (x,y,z) triplets as a surface? [message #17583 is a reply to message #17581] Tue, 02 November 1999 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Andrew <noymer@my-deja.com> writes:

>
> Is there any way to read (x,y,z) triplets into IDL and make a
> surface? Sorry if this is a terrible newbie question.

Hmm... Does this work?

; Open and read data
openr, 50, 'file.dat'
triples = fltarr(3,ntriples)
readf, 50, triples
close, 50

; Plot data. NX * NY = NTRIPLES
surf = reform(triples(2,*), nx, ny)
surface, surf

The key point is the reform expression, which takes the third
component of the triplet (triple(2,*)) and then reforms it into a 2D
array.

If you have irregular sampling or non-rectangular coverage then
obviously things start getting more difficult...

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Prevent color flashing
Next Topic: Re: point_lun question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:07:55 PDT 2025

Total time taken to generate the page: 0.00409 seconds