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
|