pro pscopy,arr ; ;Procedure to make a 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 PSCOPY,ARR. ; name='' read,'Name of the PS 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 = 16x24 cm xs=xs<16. ys=ys<24. endif else begin xs=xs<24. ys=ys<16. endelse set_plot,'PS' if por eq 1 then device,filename=name,/portrait,bits_per_pixel=8, $ xoffset=2.5,yoffset=27.-ys,xsize=xs,ysize=ys,/color,encapsulated=0 $ else device,filename=name,/landscape,bits_per_pixel=8, $ xoffset=18.5-ys,yoffset=27.,xsize=xs,ysize=ys,/color,encapsulated=0 ; 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,'PS file ',name,' created.' ; !!!!! If you use the SUN-workstation, replace 'WIN' by 'X' !!!!! set_plot,'X' end