Okay first time posting to this board. Here goes...
I use CG ALL the time now to do simple plots and find getting a clean
output sooo much nicer than standard IDL, so i thought there should be a
way to do a simple colored map output with CG. But the examples in the
book seem to about contours on top of a map, not coloring a spot on the map.
I'd appreciate any help.
Here's what i use now, and i keep getting all Black (grrrr!).
;---- set Z buffer ----
set_plot,'Z'
device,set_resolution=map_dim
; get colors
loadct, 40
TVLCT, r, g, b, /get
; Load White Color - 0 for background
r(0)=255 & g(0)=255 & b(0)=255
drawColor = 255
; Load Black Color - 255
r(255)=0 & g(255)=0 & b(255)=0
; map 'emiss' (720,1440), first, make it a vector
lats=reform(lat,1036800)
lons=reform(lon,1036800)
emis=reform(emiss,1036800)
; set up the map
map_set, /cyl, limit=[-90,0,90,360], position=[0.05,0.125,0.95,0.95],$
color=drawColor, charsize=0.8, /NOBORDER
; - if i stop after this line, i get an all WHITE .png
;-- plot fov symbol one by one ----
FOR iprof=0L,nrec-1L DO BEGIN
y=emis(iprof)
indcol=0L
xind=(float(y)/float(1))*nc + 1
indcol=long(xind) > 1L < nc
xcenter = lons(iprof)
ycenter = lats(iprof)
xxxx = [ xcenter-0.12, xcenter+0.12, xcenter+0.12, xcenter-0.12 ]
yyyy = [ ycenter-0.12, ycenter-0.12, ycenter+0.12, ycenter+0.12 ]
POLYFILL, xxxx, yyyy, color=indcol
; i get reasonable xxxx,yyyy, and indcol ranges between 0 & ~233
ENDFOR
map_continents,/continents,/noborder,/hires,/usa
; output
write_png, 'test.png', TVRD(), r, g, b
device,/close
|