David Klassen writes:
>
> So I'm tying to make a postscript output of a two-image overlay with color bar. The code I use to do this is:
>
> ymult=1.15
> cgdisplay,1080,540*ymult
> cgimage,baimg,ct=0,position=[0,0,1,1/ymult],background=0
> cgimage,bimg,transp=0,missing_index=0,ct=31,/brewer,$
> alphafgposition=[0,0,1,1/ymult]
> cgcolorbar,range=[0,0.5],format='(f0.4)',/top,ctindex=31,/br ewer,$
> position=[0.10,0.90,0.95,0.93],xticks=8,color='white',$
> title='Ice Cloud Optical Depth ('+textoidl(' \tau_{12.1 \mu m} ')+')'
>
>
> where bimg is they bytescaled version of my data overlay and baimge is the bytescaled version of my background albedo map. On screen this looks beautiful! And can use cgsnapshot to make it into a png file but the pixelated fonts, for some reason, really annoy me.
>
> When I do a cgps_open,'test.eps' and then do these commands, it doesn't work and says I need an alphabackgroundimage but if I do that, the background image fills the display. And alphabgposition also causes an error.
>
> What am I doing wrong?
Probably getting things in the wrong order. :-)
I'd try something like this:
ymult=1.15
baimg = cgDemoData(7)
bimg = cgDemoData(5)
cgdisplay,1080,540*ymult, /pixmap
cgimage,baimg,ct=0,position=[0,0,1,1/ymult],background=0
bgimage = cgsnapshot()
wdelete
cgps_open, 'imagetest.ps'
cgdisplay,1080,540*ymult
cgimage,bimg,transp=0,missing_index=0,ct=31,/brewer,$
alphafgposition=[0,0,1,1/ymult], alphabackgroundimage = bgimage
cgcolorbar,range=[0,0.5],format='(f0.4)',/top,ctindex=31,/br ewer,$
position=[0.10,0.90,0.95,0.93],xticks=8,color='white',$
title='Ice Cloud Optical Depth ('+textoidl(' \tau_{12.1 \mu m} ')+')'
cgps_close
END
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|