Need help in plotting graph of velocity (ux) vs time

Use load "PETSc" + savevtk(..., append = true);, see this example.
It will generate a .pvd file that you can open with ParaView, and you’ll have a movie.