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

Home » Public Forums » archive » Transparent overlay in postscript cgimage
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: Transparent overlay in postscript cgimage [message #92329 is a reply to message #92328] Wed, 18 November 2015 09:20 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Adding two strings together
Next Topic: running an application from the IDL virtual machine

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

Current Time: Wed Oct 08 20:10:16 PDT 2025

Total time taken to generate the page: 0.76480 seconds