pro plotbox, x,y,w,h,color=color,scale=scale,lines=lines,device=device,x0x1=x0x1
if n_params(0) lt 1 then begin
print,'Usage : plotbox,x0,y0,w,h,color=color,scale=scale,lines=lines,$'
print,'        device=device,x0x1=x0x1'
print,'        plotbox,[x0,y0,x1,y1],color=color,scale=scale,lines=lines' 
print,'        plotbox,[x0,x1],[y0,y1],color=color,scale=scale,lines=lines'
return
end 
 if n_elements(color) eq 1 then xx=color else xx=!p.color
 if n_elements(scale) eq 1 then zx=scale else zx=1.0
 if n_elements(lines) ne 0 then lin=lines(0) else lin=0

 if n_elements(x) eq 4 then begin
  if keyword_set(x0x1) then begin
    x0=x(0) & y0=x(2) & x1=x(1) & y1=x(3) 
  endif else begin 
    x0=x(0) & y0=x(1) & x1=x(2) & y1=x(3)
  end 
 endif else $
 if n_elements(x) eq 2 and n_elements(y) eq 2 then begin
  x0=x(0) & y0=y(0) & x1=x(1) & y1=y(1) 
 endif else begin& x0=x & y0=y & x1=x+w & y1=y+h &end

if keyword_set(device) then $ 
plots,[x0,x0,x1,x1,x0]*zx,[y0,y1,y1,y0,y0]*zx,color=xx,lines=lin,/dev else $
plots,[x0,x0,x1,x1,x0]*zx,[y0,y1,y1,y0,y0]*zx,color=xx,lines=lin,/data

end