pro epscopy,arr ; ;Procedure to make an ENCAPSULATED Postscript hardcopy file ;from a (color) image ARR. ;CAUTION: The /color and bits_per pixel=8 are used to make the ; hardcopy sensible to the current lookup table. ;USAGE: Create the array (e.g. ARR=TVRD() ), visualize it properly ; using XLOADCT and then call EPSCOPY,ARR. ; name='' read,'Name of the EPS file: ',name prt: print,'Do you want a PORTRAIT or LANDSCAPE format? (p/l)' if get_kbrd(1) eq 'p' then por=1 else por=0 print,'X,Y size of the figure (cm):' read,xs,ys if (xs lt 3) or (ys lt 3) then goto,prt ;minimum size = 3x3 cm if por eq 1 then begin ;maximum size = 18x24 cm xs=xs<18. ys=ys<24. endif else begin xs=xs<24. ys=ys<18. endelse set_plot,'PS' if por eq 1 then device,filename=name,/portrait,bits_per_pixel=8, $ xsize=xs,ysize=ys,/color,/encapsulated $ else device,filename=name,/landscape,bits_per_pixel=8, $ xsize=xs,ysize=ys,/color,/encapsulated ; tv,bytscl(arr),0,0,xsize=xs-0.1,ysize=ys-0.1,/centimeters tv,bytscl(arr,top=!d.n_colors),0,0,xsize=xs-0.1,ysize=ys-0.1,/centimeters device,/close print,'EPS file ',name,' created.' ; !!!!! If you use the SUN-workstation, replace 'WIN' by 'X' !!!!! set_plot,'WIN' end