Petros Syntelis writes:
> Has anybody tried to create transparent images with axis and done it correctly?
Not this way, no. :-)
Too much going on here for the hacking that has to take place in direct
graphics. I would do this a completely different way. I would write the
program like this:
;****************************************************
PRO Example, PS=ps
; Fake images.
im1 = cgDemoData(7)
im2 = cgDemoData(21)
im3 = cgDemoData(22)
im4 = cgDemoData(5)
; Build composite images.
cgDisplay, 400, 500, WID=2, /Pixmap
cgimage, im1
cgimage, im4, ctindex=33, $
AlphaFGPos=[0.0,0.25,1.0,0.75], transparent=50
snap1 = cgSnapShot()
cgimage, im2
cgimage, im4, ctindex=33, $
AlphaFGPos=[0.0, 0.25, 1.0, 0.75], transparent=50
snap2 = cgSnapShot()
cgimage, im3
cgimage, im4, ctindex=33, $
AlphaFGPos=[0.0, 0.25, 1.0, 0.75], transparent=50
snap3 = cgSnapShot()
; Delete the Pixmap.
WDelete, 2
; Set multimargin and character size values.
mm = 12
cs = 2.25
; Need a PostScript file?
IF Keyword_Set(ps) THEN BEGIN
cgPS_Open, 'example.ps'
mm = 8
cs = 1.75
ENDIF
; Display them.
cgDisplay, 1200, 500
!P.Multi=[0,3,1]
cgimage, snap1, multimargin=mm, /axes, $
OPosition=opos, axkey={charsize:cs}
yrange = opos[3] - opos[1]
p1 = opos[1] + yrange*0.25
p3 = opos[3] - yrange*0.25
cgPlot, [1], /NoData, /NoErase, Charsize=cs, $
Position=[opos[0], p1, opos[2], p3], AxisColor='red'
cgimage, snap2, multimargin=mm, /axes, $
OPosition=opos, axkey={charsize:cs}
yrange = opos[3] - opos[1]
p1 = opos[1] + yrange*0.25
p3 = opos[3] - yrange*0.25
cgPlot, [1], /NoData, /NoErase, Charsize=cs, $
Position=[opos[0], p1, opos[2], p3], AxisColor='red'
cgimage, snap3, multimargin=mm, /axes, OPosition=opos, $
axkey={charsize:cs}
yrange = opos[3] - opos[1]
p1 = opos[1] + yrange*0.25
p3 = opos[3] - yrange*0.25
cgPlot, [1], /NoData, /NoErase, Charsize=cs, $
Position=[opos[0], p1, opos[2], p3], AxisColor='red'
!P.Multi=0
IF Keyword_Set(PS) THEN BEGIN
cgPS_Close, /PNG
ENDIF
END
;****************************************************
To see it on the display:
IDL> Example
To see it in a PostScript and PNG file:
IDL> Example, /PS
Cheers,
David
--
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.")
|