In article <33010900.41C67EA6@astrosun.tn.cornell.edu> John-David Smith
<jdsmith@astrosun.tn.cornell.edu> writes:
> Here's some summarizing code (for those whose decompose the written word more
> readily into code fragments and blocks than sentences and paragraphs):
The following might be a (beginning of a) solution:
I took the example "as is", added some test data generation, made it
work and then commented. I doubled the example to have two drawings
under each other, which is (I presume) the goal. I did NOT try to
make the whole thing look nice, but just made it work. The original
text starts with an offset, practically all my additions start in col.1
Don't even start reading, if you don't REALLY want to know!
e0=findgen(21)
e1=fltarr(21,21)
e2=e1
for i=0,20 do begin &$
e1(i,*)=e0 &$
e2(*,i)=e0 &$
endfor
zmt0=dist(21)
zmt=zmt0/max(zmt0)*1.3
zm1=-zmt+1.3
zm2=zmt0*0+.65
; that was the test data generation
dev=!D
set_plot,'Z'
!P.BACKGROUND=!D.N_COLORS-1 ; to get white background
device,set_character_size=[dev.x_ch_size,dev.y_ch_size]
!p.position=[.1,.55,.9,.9]
; since you want to have the shape and the axes in the same place
; you will have to work with !p.position
;; put 3 surfs atop eachother ... the z's and e's are concocted elsewhere
shade_surf,zmt,e1,e2,shades=bytscl(zmt,TOP=!d.table_size), $
charsi=2.25,/save,az=20,zrange=[0,1.3],xst=4,yst=4,zst=4
tr1=!p.t
; better save your current trafo
shade_surf,zm1,e1,e2,shades=zm1*0B+!d.table_size/3,/T3D, $
xst=4,yst=4,zst=4,charsi=2.25,/NOERASE,zrange=[0,1.3]
shade_surf,zm2,e1,e2,shades=zmt*0B+!d.table_size/4,/NOERASE, /T3D, $
xstyle=4,ystyle=4,zstyle=4,charsi=2.25,zrange=[0,1.3]
;; get the pixture out
; a=tvrd()
; don't save the picture, you are not done yet
!p.position=[.1,.1,.9,.45]
; here the lower picture
;; put 3 surfs atop eachother ... the z's and e's are concocted elsewhere
shade_surf,zmt,e1,e2,shades=bytscl(zmt,TOP=!d.table_size), $
charsi=2.25,/save,az=20,zrange=[0,1.3],xst=4,yst=4,zst=4,/no erase
; charsi=2.25,/save,az=20,zrange=[0,1.3],xst=4,yst=4,zst=4
; had to add /noerase (both pictures on 1 frame)
tr2=!p.t
; and save the second trafo
shade_surf,zm1,e1,e2,shades=zm1*0B+!d.table_size/3,/T3D, $
xst=4,yst=4,zst=4,charsi=2.25,/NOERASE,zrange=[0,1.3]
shade_surf,zm2,e1,e2,shades=zmt*0B+!d.table_size/4,/NOERASE, /T3D, $
xstyle=4,ystyle=4,zstyle=4,charsi=2.25,zrange=[0,1.3]
;; get the pixture out
a=tvrd()
ratio=float(!d.y_size)/!d.x_size
; have to keep the current frame ratio
set_plot,'ps'
; I think the set_plot was forgotten in the original
; device,BITS=8, xsize=8.5,ysize=11.,xoffset=0.,yoffset=0.,/inches
device,BITS=8, xsize=7.,ysize=7.*ratio,xoffset=1.,yoffset=1.,/inches
; I adjusted the xsize and offsets to fit A4 paper format
; ysize is NOT free, but has to be adjusted to the proportions used
; in the z-buffer
; !P.MULTI=[0,1,3,0,0]
; You can't use that - or rather I can't use that in this context :-)
; tv,a,.5,5,xsize=5,ysize=5,/inches
tv,a
; you cannot put your picture SOMEWHERE, but only where it was (i.e. 0,0)
; also you can't adjust the size as you please (well...probably you COULD
; if you would coordinate it with the "ratio", but..)
;; now add the axes....
!p.position=[.1,.55,.9,.9]
!p.t=tr1
; restore the !p.position and transformation for the 1st picture
shade_surf,zmt,e1,e2,/T3D,xtitle='e!d1',ytitle='e!d2', $
ztitle='Normalized Merit',/NODATA,/NOERASE, $
TITLE='Ritchey-Chretian Optimization',charsi=2.25,zrange=[0,1.3]
!p.position=[.1,.1,.9,.45]
!p.t=tr2
; restore the !p.position and transformation for the 2nd picture
shade_surf,zmt,e1,e2,/T3D,xtitle='e!d1',ytitle='e!d2', $
ztitle='Normalized Merit',/NODATA,/NOERASE, $
TITLE='Ritchey-Chretian Optimization',charsi=2.25,zrange=[0,1.3]
device,/close
set_plot,'X'
; ... and viola! (TM)
Greetings to everybody who made it through,
George ;-)
--
------------------------------------------------------------ ------------------
George M.Sigut, ETH Informatikdienste, Anwenderunterstuetzung, CH-8092 Zurich
Swiss Federal Institute of Technology, Computing Services, User Support
email: sigut@awu.id.ethz.ch Phone: +41 1 632 5763 Fax: +41 1 632 1312
>>>>>>>>> in case of email problems send the mail to "sigut@acm.org" <<<<<<<<<
------------------------------------------------------------ ------------------
|