;
;
xvectemp=xvec                   ;dont corrupt return
if n_params() eq 1 then begin           ;plot against index
   datatemp = xvectemp
   xvectemp = indgen(n_elements(datatemp(0,*)))
endif else datatemp = data 
;
type = size(datatemp)
n_vectors = type(1)             ; #input vectors
;
if not keyword_set(which) then which = $
    make_array (n_vectors,/int) + 1     ; enable all plots
;
if not keyword_set(style) then style=intarr(2)
n_plots = total(which)
;
if not keyword_set(pad) then pad = 0        ;default is no margin
;
if not keyword_set(title) then title = ''   ; default no title
;
plot_types=['utplot','plot_io']         ;plot type -> string
select = keyword_set(log)           ;selection
plot_type = plot_types(select)
;
line_types = 5                  ;number of styles   
;
min = min(datatemp(where(which)>0,*))       ;auto scale for
max = max(datatemp(where(which)>0,*))       ;selected vectors
;
pad = (max-min)*.01*pad             ;y pad = range*pad%
min = min - pad                 ;adjust plot margin
max = max + pad
;
minimum = [min,1e-10]               ;log range protect
min = max([min,minimum(select)])
;
; if user has not done so, draw box with appropriate scaling
;
if not keyword_set(oplot) then $
   call_procedure,plot_type, xvectemp, datatemp(0,*), /nodata, $
    yrange=[min,max],xstyle=style(0), ystyle=style(1),title=title
;
; for each input vector, plot it if which switch enabled
;
for i=0,n_vectors-1 do begin
   if (which(i))   then $       
      outplot,xvectemp, datatemp(i,*), psym = i mod line_types + 1, $
     thick = i/line_types+1
endfor
return
end