Hi all,
i am new to Julia and trying to plot a dynamic vector field generated by PIV analysis. I tried to achieve by ploting the vector fields in a for loop and at each step clear the old vector field and replace it with the new one. However, although adding sleep() to delay the plot, I only get the final vector field without seeing a movie/update.
Does anybody has an idea why this happens and if there is a solution for it? Or other better way to plot dynamic vector fields?
Thanks a lot!
using Plots, PyPlot, multi_quickPIV
default_params = multi_quickPIV.setPIVParameters()
IA_size = multi_quickPIV._isize( default_params )[1:2]
IA_step = multi_quickPIV._step( default_params )[1:2]
for t in 1:2
PyPlot.clf()
img1 = Float64.(Gray.(l_data[:, :, t]))
img2 = Float64.(Gray.(l_data[:, :, t+1]))
VF, SN = multi_quickPIV.PIV(img1, img2)
U = VF[ 1, :, : ]
V = VF[ 2, :, : ]
xgrid = [ (x-1)*IA_step[2] + div(IA_size[2],2) for y in 1:size(U,1), x in 1:size(U,2) ];
ygrid = [ (y-1)*IA_step[1] + div(IA_size[1],2) for y in 1:size(U,1), x in 1:size(U,2) ];
PyPlot.quiver( xgrid, ygrid, V, -1 .* U )
PyPlot.sleep(0.1);
end