# ListVectorPlot contour lines

I dont know why so many plot functions lack the option to display contour lines (judging by the search result for [plot function] contour lines) but ListVectorPlot is among them.

If I have an array t of {vx,vy} coordinates, do you know a way to plot it with overimposed the contour lines?

• As in ListVectorDensityPlot[]? It doesn't have lines, but really lines just clutter up such a graph. You might have to superimpose two graphs if you really want the lines themselves. – Feyre Jul 1 '16 at 11:46
• Have a look at MeshFunctions. – J. M. will be back soon Jul 1 '16 at 12:09
• Two options come to mind, first the StreamPoints option VectorPlot and ListVectorPlot. Second, you could just use Show to combine different types of 2D plots – Jason B. Jul 1 '16 at 12:46
• @J.M.: I never used it so probably I made some mistake. I tried this syntax: ListVectorPlot[tt, VectorPoints -> 40, Mesh -> 20, MeshFunctions -> {#1 &}] and though I get no error, I see no meshes... – alessandro Jul 1 '16 at 13:00
• @JasonB: I thought it was a great idea using StreamPoints, until I realized that the streamlines are exactly perpendicular to the direction I need, that is the contour line! – alessandro Jul 1 '16 at 13:01

Here is a ListVectorPlot superimposed on top of ListContourPlot(s) of the vx, vy, and magnitudes

data = Import["~/Downloads/tt.mat"];
vectorplot = ListVectorPlot[Transpose@data, VectorStyle -> Red];
Show[ListContourPlot[Map[#, data, {2}]], vectorplot, ImageSize -> 400,
PlotRange -> All] & /@ {First, Last, Norm[#]^2 &}


Or you can use MeshFunctions to get the contour lines out of ListVectorDensityPlot

ListVectorDensityPlot[Map[#, Transpose@data, {2}], Mesh -> 10,
MaxRecursion -> 3, ImageSize -> 400,
VectorStyle -> Red] & /@ {{#, First@#} &, {#, Last@#} &, {#,
Norm@#} &}


• thanks! I understand better how to do it now... – alessandro Jul 1 '16 at 14:19