In article <davidf-ya023080001202971148240001@news.frii.com>
davidf@dfanning.com (David Fanning) writes:
> ... My only
> problem with George is that he writes really ugly IDL code,
> but I'm not going to hold that against him. :-)
Just so that David and everybody else doesn't think that the Swiss
do not wash their necks or something, here is a nicer version of the
code (the result is as ugly as before)
-----------------------------------------------------------
zmt = dist(21)/max(dist(21)) * 1.3
zm1 = - zmt + 1.3
zm2 = fltarr(21,21) + .65
pos1 = [.1,.55,.9,.9] ; top picture
pos2 = [.1,.1,.9,.45] ; bottom picture
!z.range = [0,1.3]
!p.charsize = 2.25
dev = !D
set_plot, 'Z'
device, set_character_size=[dev.x_ch_size,dev.y_ch_size]
ratio = float(!d.y_size)/!d.x_size
!P.BACKGROUND = !D.N_COLORS - 1 ; to get white background
!x.style = 4 & !y.style = 4 & !z.style = 4
!p.position = pos1
shade_surf, zmt, shades=bytscl(zmt,TOP=!d.table_size), az=20, /SAVE
shade_surf, zm1, shades=zm1*0B+!d.table_size/3, /T3D, /NOERASE
shade_surf, zm2, shades=zmt*0B+!d.table_size/4, /T3D, /NOERASE
tr1 = !p.t
!p.position = pos2
shade_surf, zmt, shades=bytscl(zmt,TOP=!d.table_size), az=20, /SAVE, /NOERASE
shade_surf, zm1, shades=zm1*0B+!d.table_size/3, /T3D, /NOERASE
shade_surf, zm2, shades=zmt*0B+!d.table_size/4, /T3D, /NOERASE
tr2 = !p.t
a = tvrd()
set_plot, 'PS'
device, BITS=8, xsize=7, ysize=7*ratio, xoffset=1, yoffset=1, /inches
tv,a
!x.style = 0 & !y.style = 0 & !z.style = 0
!p.position = pos1
!p.t = tr1
shade_surf, zmt, /T3D, /NOERASE, /NODATA, $
TITLE='Ritchey-Chretian Optimization', $
XTITLE='e!d1', YTITLE='e!d2', ZTITLE='Normalized Merit'
!p.position = pos2
!p.t = tr2
shade_surf, zmt, /T3D, /NOERASE, /NODATA, $
TITLE='Ritchey-Chretian Optimization', $
XTITLE='e!d1', YTITLE='e!d2', ZTITLE='Normalized Merit'
device, /close
set_plot, 'X'
-----------------------------------------------------------
...yes I know, there are no comments in the code. :-b
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" <<<<<<<<<
------------------------------------------------------------ ------------------
|