; $Id: eplot.pro,v 1.2 2002/01/14 20:59:26 amunter Exp $
pro eplot,x,y,sigyup,sigylo,charsize=cha,color=col,linestyle=lin, $
    noclip=noc,noerase=noe, $
    psym=psy,subtitle=sub,symsize=sym,t3d=t3d,thick=thi,title=tit, $
    xrange=xra,xtitle=xti,xtype=xty,xstyle=xst,ynozero=yno, $
    yrange=yra,ytitle=yti,ytype=yty,ystyle=yst,zvalue=zva
;+
; NAME:
;		eplot
; PURPOSE:
;		Plot a vector with error bars.
; CATEGORY:
; CALLING SEQUENCE:
;		eplot,y,sigy
;		eplot,x,y,sigy
;		eplot,y,sigy_up,sigy_down
;		eplot,x,y,sigy_up,sigy_down
; INPUTS:
; OPTIONAL INPUT PARAMETERS:
; KEYWORD PARAMETERS:
;		Graphics keywords: charsize,color,linestyle,noclip,
;		noerase,psym,subtitle,symsize,t3d,thick,title,xrange,
;		xtitle,xtype,xstyle,ynozero,yrange,ytitle,ytype,ystyle,
;		zvalue
; OUTPUTS:
; OPTIONAL OUTPUT PARAMETERS:
; COMMON BLOCKS:
; SIDE EFFECTS:
; RESTRICTIONS:
; PROCEDURE:
; MODIFICATION HISTORY:
;		D. L. Windt, AT&T Bell Laboratories, November 1989
;-

on_error,2

if keyword_set(cha) then charsize=cha else charsize=!p.charsize
if keyword_set(col) then color=col else color=!p.color
if keyword_set(lin) then linestyle=lin else linestyle=!p.linestyle
if keyword_set(noc) then noclip=1 else noclip=!p.noclip
if keyword_set(noe) then noerase=1 else noerase=0
if keyword_set(psy) then psym=psy else psym=!p.psym
if keyword_set(sub) then subtitle=sub else subtitle=!p.subtitle
if keyword_set(sym) then symsize=sym else symsize=1
if keyword_set(thi) then thick=thi else thick=!p.thick
if keyword_set(tit) then title=tit else title=!p.title
if keyword_set(t3d) then t3d=t3d else t3d=!p.t3d
if n_elements(xra) eq 0 then xrange=!x.range else xrange=xra
if keyword_set(xti) then xtitle=xti else xtitle=!x.title
if keyword_set(xty) then xtype=xty else xtype=!x.type
if keyword_set(xst) then xstyle=xst else xstyle=!x.style
if keyword_set(yno) then ynozero=yno else ynozero=0
if n_elements(yra) eq 0 then yrange=!y.range else yrange=yra
if keyword_set(yti) then ytitle=yti else ytitle=!y.title
if keyword_set(yty) then ytype=yty else ytype=!y.type
if keyword_set(yst) then ystyle=yst else ystyle=!y.style
if keyword_set(zva) then zvalue=zva else zvalue=0
;
plot,x,y,chars=charsize,color=color,linestyle=linestyle, $
    noclip=noclip,noerase=noerase,psym=psym, $
    subtitle=subtitle,symsize=symsize,thick=thick,title=title,t3d=t3d, $
    xrange=xrange, $
    xtitle=xtitle,xtype=xtype,xstyle=xstyle,ynozero=ynozero, $
    yrange=yrange,ytitle=ytitle,ytype=ytype,ystyle=ystyle,zvalue=zvalue
psym=!p.psym
!p.psym=0
xt=fltarr(2)
yt=xt
if n_params() eq 3 then sigylo=sigyup
for i=0,n_elements(x)-1 do begin
  xt(0)=x(i)
  xt(1)=x(i)
  yt(0)=y(i)
  yt(1)=y(i)+sigyup(i)
  oplot,xt,yt,color=color,line=linestyle,noclip=noclip,t3d=t3d,zvalue=zvalue
  yt(1)=y(i)-sigylo(i)
  oplot,xt,yt,color=color,line=linestyle,noclip=noclip,t3d=t3d,zvalue=zvalue
  endfor
!p.psym=psym

end
