Viewing contents of file '../idllib/contrib/tappin/graffer/gr_pl_axes.pro'
pro Gr_pl_axes, pdefs, csiz, overlay=overlay

;+
; GR_PL_AXES
;	Plot axes for GRAFFER
;
; Usage:
;	gr_pl_axes, pdefs, csiz[, /overlay]
;
; Argument:
;	pdefs	struct	input	The ubiqitous GRAFFER control
;				structure
;	csiz	float	input	Charsize scaling (hardcopy only).
;
; Keyword:
;	overlay	??	input	If set, then don't erase before plotting
;				(used to replace the ticks afer doing
;				a colour plot).
;
; History:
;	Cut from GR_PLOT_OBJECT and overlay added: 11/12/96; SJT
;	Made unique in 8.3: 11/2/97; SJT
;-

if ((pdefs.xsty.time) and 1) then begin
    xtf = 'gr_time_fmt'
    junk = gr_time_fmt(0, range = pdefs.xrange, options = $
                       pdefs.xsty)
endif else xtf = ''

if (pdefs.xsty.grid ne 0 and ((pdefs.xsty.idl and 12) eq 0)) then begin
    xtickl = 0.5
    xtickst = pdefs.xsty.grid-1
endif else begin
    xtickl = 0.
    xtickst = 0
endelse
if (pdefs.ysty.grid ne 0 and ((pdefs.ysty.idl and 12) eq 0)) then begin
    ytickl = 0.5
    ytickst = pdefs.ysty.grid-1
endif else begin
    ytickl = 0.
    ytickst = 0
endelse

if (pdefs.aspect(0) gt 0.) then $
  !P.position = aspect(pdefs.aspect(0), margin = pdefs.aspect(1)) $
else if (pdefs.position(2) gt pdefs.position(0) and $
         pdefs.position(3) gt pdefs.position(1)) then $
  !P.position = pdefs.position

plot, /nodata, fltarr(2), title = pdefs.title, subtitle = $
  pdefs.subtitle, xrange = pdefs.xrange, xtitle = pdefs.xtitle, xtype $
  = pdefs.xtype, xsty = pdefs.xsty.idl, yrange = pdefs.yrange, ytitle = $
  pdefs.ytitle, ytype = pdefs.ytype, ysty = pdefs.ysty.idl, $
  charsize = pdefs.charsize*csiz, xthick = pdefs.axthick, ythick = $
  pdefs.axthick, xminor = pdefs.xsty.extra and 1, yminor = $
  pdefs.ysty.extra and 1, xtickformat = xtf, xticklen = xtickl, $
  xgridsty = xtickst, yticklen = ytickl, ygridsty = ytickst, noerase = $
  keyword_set(overlay)

if ((pdefs.xsty.idl and 4) ne 0) then xzat = pdefs.xtitle $
else xzat = ''
if ((pdefs.ysty.idl and 4) ne 0) then yzat = pdefs.ytitle $
else yzat = ''

if ((pdefs.xsty.extra/2) and 1) then axis, xaxis = 0, pdefs.xrange(0), $
  0., xminor = pdefs.xsty.extra and 1, xtickformat = xtf, xrange = $
  pdefs.xrange, xsty = pdefs.xsty.idl, xthick = pdefs.axthick, xtitle $
  = xzat 
if ((pdefs.ysty.extra/2) and 1) then axis, yaxis = 0, 0., $
  pdefs.yrange(0), yrange = pdefs.yrange, ysty = pdefs.ysty.idl, $
  ythick = pdefs.axthick, yminor = pdefs.ysty.extra and 1, ytitle = $
  yzat

end