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

Home » Public Forums » archive » Re: reading large multicolumn data file
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: reading large multicolumn data file [message #72133 is a reply to message #72132] Fri, 06 August 2010 07:46 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
bio_amateur writes:

> Now, plotting is pretty fast. However, data reading is still slow,
> compared to xmgrace. Is there a better way than using the 2 steps:
> read the data into a structure, and convert a structure to an array as
> the way I did.
>
> The second question is xmgrace autoamtically choose one color for each
> data field (Y1, Y2, ...). However, with direct graphics in IDL, I only
> get one single color. How could we resolve this in IDL.

I'd try something like this:

rows = File_Lines(filename)
data = FltArr(4, rows)
Openr, lun, filename, /Get_Lun
ReadF, lun, data
Free_Lun, data
data = Transpose(data)

colors = ['black', 'white', 'red', 'green', 'blue']
Plot, data[*,0], data[1,*], Background=FSC_Color(colors[1]), $
Color=FSC_Color(colors[0]), /NoData
FOR j=1,3 DO OPlot, data[*,0], data[*,j], COLOR=FSC_Color(colors[j+1])

You can find FSC_Color in the Coyote Library:

http://www.dfanning.com/documents/programs.html

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: quick question to get me started on mapping
Next Topic: concatenate by columns

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

Current Time: Sat Oct 11 09:33:54 PDT 2025

Total time taken to generate the page: 1.19857 seconds