# Contour heat graph (ListContourPlot?)

I have solved 2D incompressible Navier Stokes and written out a .dat file that includes x,y,u,v,p values. I am trying to get a 2D color heat graph like this one for my data

Here is what I have done so far trying to use Contourplot:

Data = Import[
"C:\\Users...
x = Data[[3 ;; 16002, 1]];
y = Data[[3 ;; 16002, 2]];
u = Data[[3 ;; 16002, 3]];
v =  Data[[3 ;; 16002, 4]];
p =  Data[[3 ;; 16002, 5]];
grid = Transpose[{x, y}];
ListPlot[grid, PlotLabel -> "MeshPoints", AxesLabel -> {"x", "y"},
PlotRange -> Automatic, AspectRatio -> Automatic]
velocity = Transpose[{x, y, Sqrt[u*u + v*v]}];
pressure = Transpose[{x, y, p}];
ListContourPlot[velocity]
ListContourPlot[pressure]


My steady state solution is in this .dat file

I am able to make my solution look like this with TecPlot.

For some reason Mathematica with ListContourPlot plots two fairly large gaps in the middle of the graph.

• Try ColorFunction and ColorData. Commented Apr 30, 2013 at 22:41
• @l3win, out of curiosity, how did you solve the Navier-Stokes equations?
– user21
Commented May 1, 2013 at 6:58
• @ruebenko any chance in future for NDSolve to solve Navier-Stokes out of the box..? Commented May 1, 2013 at 17:23
• I used what is called the Projection Method for incompressible Navier-Stokes. I did not solve it with Mathematica but with Fortran :) Commented May 1, 2013 at 17:23
• @PlatoManiac, as much as I would like too, my contract with WRI does not allow me to discuss future development. I do, however, have a Navier-Stokes solver written in Mathematica. It would need (a lot of :-) polishing, however.
– user21
Commented May 1, 2013 at 17:52

This is similar to your picture:

ListContourPlot[velocity, ColorFunction -> "Rainbow",
PlotLegends -> Automatic, PlotRange -> All, Contours -> 99,
ContourStyle -> {None}]


But this is on a finer grain

ListContourPlot[velocity, ColorFunction -> "Rainbow", PlotLegends -> Automatic]


ListContourPlot[velocity, ColorFunction -> "Rainbow",
PlotLegends -> Automatic, Contours -> 99, ContourStyle -> {None}]


• Aaah Mathematica 9!!! Your PlotLegends is now fixed.... it was so messed up in Mathematica 8.0 Commented Apr 30, 2013 at 23:25
• what do you mean fixed? I am unable to use the command belisarius posted. It gives me an error for PlotLegends Commented May 1, 2013 at 3:36
• Does ListContourPlot only take in PlotLegends for Mathematica 9? Commented May 1, 2013 at 3:52
• Maybe I just have to edit how the contours are plotted and the range which they are plotted. Trying to get rid of the two big white gaps in the middle of the graph still Commented May 1, 2013 at 18:13
• @l3win There is a scaling problem. Let me try to fix it Commented May 1, 2013 at 18:25