pro laser,X_SIZE=XLEN,Y_SIZE=YLEN,ASPECT=ASP,SCALE=SF,reset=reset,portrait=portrait
;+
; Name:
;	LAND
; Purpose:
;	Set up PostScript parameters for landscape.
;
;	No arguments are required for 5" by 5" plots.
;	The ASPECT keyword overrides YLEN.
;
; Optional Inputs:
;	XLEN	= X axis length (in)
;	YLEN	= Y axis length (in)
;	ASP	= Ratio of Y?X AXIS lengths (overrides YLEN)
;	SF	= Global scaling factor
;
; Modification History:
;	Aug 1991,	Mons Morrison
;	Jan 1991,	Adapted by J.R. Lemen from E.S. Claflin program
;	25-Oct-93 (MDM) - Adjusted the size for the /PORTRAIT option
;-----------------------------------------------------------------------------

    if n_elements( reset ) eq 0 then reset = 0
    if reset ne 0 then begin
      !p.charsize = 0
      !p.position = 0
      !p.thick    = 0
      !x.thick    = 0
      !y.thick    = 0
      !p.ticklen  = 2.e-2
      return
    endif

    if !d.name ne 'PS' then return		; Works only for PostScript
    if n_elements( SF ) eq 0 then SF = 1.	; Global Scale Factor

    len_long = 8.	;11  (10.6)
    len_shrt = 5.5	;8.5 
    if (keyword_set(portrait)) then begin
	;PORTRAIT
        ;XPAGE=8.5 & YPAGE=10.6 & XOFFS=0 & YOFFS=0  ;INCHES
	 XPAGE=7.0 & YPAGE=9.5 & XOFFS=0.75 & YOFFS=1  ;INCHES
	if n_elements( XLEN ) eq 0 then XLEN = len_shrt	; Default X length
	if n_elements( YLEN ) eq 0 then YLEN = len_long	; Default Y length
	;xsize and ysize are dimensions of the entire plotting area
	; (which may include more than one plot)
	DEVICE,/PORTRAIT
    end else begin
	;LANDSCAPE, Usable page size (XPAGE,YPAGE) is for Apple LaserWriter
	XPAGE=10.6 & YPAGE=8.5 & XOFFS=0 & YOFFS=XPAGE  ;INCHES
	if n_elements( XLEN ) eq 0 then XLEN = len_long	; Default X length
	if n_elements( YLEN ) eq 0 then YLEN = len_shrt	; Default Y length
	DEVICE,/LANDSCAPE
    end

    DEVICE,/COLOR,/INCHES,XSIZE=XPAGE,YSIZE=YPAGE,XOFFSET=XOFFS, YOFFSET=YOFFS

; ASPECT = RATIO OF Y/X AXIS LENGTHS:
    if n_elements( ASP ) ne 0 then ASPECT = ASP else ASPECT = YLEN/XLEN

    ;The page is taken to always be in portrait orientation.  If /landscape
    ;  is specified, then the plotting area is rotated 90 deg. clockwise so
    ;  that the lower left corner of the plotting area as viewed from the
    ;  landscape perspective is actually near the upper left corner of the
    ;  page.  XOFFSET AND YOFFSET are measured in an x,y coordinate system
    ;  with origin at the lower left corner of the portrait page.  XSIZE and
    ;  YSIZE, on the other hand, are measured in an x,y coordinate system
    ;  with origin at the lower left corner of the plotting area.
    ;Here we are not specifying the region (includes numbers, title, and
    ;  labels, as well as axes).  If we wished to specify the
    ;  the region we would set !P.REGION=[x0,y0,x1,y1], where the x,y
    ;  pairs are dimensionless (0 to 1) coordinates of the lower left and
    ;  upper right corners of the region.

    XLEN0 = XLEN * SF				; Inches
    YLEN0 = XLEN*ASPECT				; Inches

;X0,Y0 are the coordinates of the lower left corner of the plot window
;  relative to the lower left corner of the page.
    X0=(XPAGE-XLEN0)/2 & Y0=(YPAGE-YLEN0)/2	; Inches
    !P.CHARSIZE=1.2*SF				; Scale the symbol size

;; !P.POSITION=[X0/XPAGE,Y0/YPAGE,(X0+XLEN0)/XPAGE,(Y0+YLEN0)/YPAGE]
  !x.thick=1.5*SF
  !y.thick=1.5*SF
  !P.thick=1.5*SF & !P.CHARTHICK=1.2*SF & !P.ticklen=.002*(XLEN>YLEN)

return
end
