I tried to plot the following curves in Mathematica using "ListContourPlot" , and compared them with the results from Matlab 2019a.
Mathematica code: (cite from Reference (1))
meshgrid[x_List, y_List] := {ConstantArray[x, Length[x]],
Transpose@ConstantArray[y, Length[y]]}
{xx, yy} = meshgrid[Range[-2, 2, 0.1], Range[-4, 4, 0.2]];
c = xx*Exp[-xx^2 - yy^2];
pts = Flatten[{xx, yy, c}, {2, 3}];
ListContourPlot[pts]
Matlab code:
x = linspace(-2,2,40);
y = linspace(-4,4,40);
[X,Y] = meshgrid(x,y);
Z = X .* exp(-X.^2 - Y.^2);
contourf(X,Y,Z,10)
The plotting effects from both softwares are not the same.
My question is how can we have the ContourPlot effects (this example) like those in Matlab?
References:
ListContourPlot[pts, PlotRange -> All, Contours -> 10, ColorFunction -> "BlueGreenYellow"]
? $\endgroup$Contours -> DeleteCases[0][Subdivide[-3, 3, 10]/10]
? $\endgroup$ListContourPlot[pts, PlotRange -> All, Contours -> DeleteCases[0][Subdivide[-3, 3, 10]/10], ColorFunction -> "BlueGreenYellow", AspectRatio -> 1/GoldenRatio]
$\endgroup$