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

Home » Public Forums » archive » Color table
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Color table [message #81902] Sat, 10 November 2012 15:21 Go to next message
Gompie is currently offline  Gompie
Messages: 76
Registered: August 2012
Member
Hi,
I have a single variable spread over three years. I wish to give a different color to each year.

But instead of color I get grey scale. I have the following script.


cgLoadCT, 4, NCOLORS=3, CLIP=[16,240]
bplate=fltarr(18)
name=strarr(18)
mont=fltarr(19)
years=fltarr(19)
ffiles = FILE_SEARCH('*.txt1')
for index=0,n_elements( ffiles)-1 do begin
year=(strsplit(ffiles(index),'.,_',/extract))[0]
month=(strsplit(ffiles(index),'.,_',/extract))[1]
name(index)=string(month)
years(index) = float(year)
OPENR, lun, ffiles(index), /GET_LUN
temp=0.0D
i=0L
data=strarr(1)
print,ffiles(index)
WHILE ~ EOF(lun) DO BEGIN
readf,lun,data
temp=float(data) + temp
i=i+1
;print,i,float(data),data
ENDWHILE
print,temp/i
bplate(index)=temp/i
mont(index)=index
close,lun
free_lun,lun
endfor

colors = Scale_Vector(Findgen(3), 2009, 2011)

elevColors = Value_Locate(colors,years )
elevColors = StrTrim(Round(Scale_Vector(elevColors, 0, 10)),2)

!X.TICKNAME=name

cgplot,mont,bplate,psym=4,thick=2,xticks=17,yrange=[260,270] ,xtitle='MONTHS',ytitle='MIN_0_87_MICRON_DETECTOR_TEMP',BACK GROUND = 255, COLOR = 0
FOR j=0,n_elements(mont)-2 DO cgPlotS, mont[j], bplate[j], Color=elevColors[j], Thick=2,psym=sym(5),symsize = 1.15
fname="bplate.gif"
result = cgSnapshot(FILENAME=fname,/gif ,/nodialog)

Question .2 . Is it possible to view the exact colors Vs color number that are finally loaded by the color table.

Thanks in advance.
Gompie
Re: Color table [message #82046 is a reply to message #81902] Sat, 10 November 2012 20:46 Go to previous message
Gompie is currently offline  Gompie
Messages: 76
Registered: August 2012
Member
Thanks David !!!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using self reference in WHERE statement?
Next Topic: Re: Using self reference in WHERE statement?

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

Current Time: Wed Oct 08 15:17:13 PDT 2025

Total time taken to generate the page: 0.29561 seconds