subr motionplot,del,nxin,nyin,sc,sym
;for plotting displacement grids as an offset from grid location
;default is actual offset in grid units or multiplied by sc
;each point plotted with sym with -1 the default
;ck if nx and ny passed
if !narg ge 2 then nx=nxin else nx=512
if !narg ge 3 then ny=nyin else ny=512
if !narg ge 4 then fac=sc else fac=1.0
if !narg ge 5 then psym=sym else psym=-1
;ck if really a del array
if num_dim(del) ne 3 or dimen(del,0) ne 2 then { type,'DELPLOT - input not a-
 displacement array'  return }
nxg=dimen(del,1)	nyg=dimen(del,2)
wx=float(nx)/nxg
wy=float(ny)/nyg
;this is supposed to compute the grid the same way as Stu's programs
gx=indgen(fltarr(nxg,nyg),0)*wx+wx/2.-1
gy=indgen(fltarr(nxg,nyg),1)*wy+wy/2.-1
;scale to the plot window
gx=(gx+fac*del(0,*,*))*(!wxt-!wxb)/nx + !wxb
gy=(gy+fac*del(1,*,*))*(!wyt-!wyb)/ny + !wyb
xymov,gx(0),gy(0),0
xymov,gx,gy,psym
endsubr
