# Why the ContourPlot and ListContourPlot show reversed plot?

dear All! Here are my code for the same kind of plot, because I thought Contour Plot is time-consuming, so I tried ListContourPlot instead. But I don't understand why the figure generated by ListContourPlot seems to have flipped axis?

Code using test function:

F[x_, c_] := 1 - CDF[NormalDistribution[0, 1], InverseCDF[NormalDistribution[0, 1], 1 - x] - c]

maxp[a_, b_, c_, alpha_] := F[alpha, (10* a)/Sqrt[1 - a^2]] * F[alpha, (10 * b *Sqrt[(1 - a^2)])/Sqrt[1 - c^2 - b^2 - 2*a*b*c]]

ListContourPlot[Table[maxp[a, b, 0, 0.05], {a, 0, 0.96, 0.02}, {b, 0, 0.96, 0.02}] ,
ColorFunction -> (ColorData["BlueGreenYellow"]),  FrameLabel -> {a, b},
PlotLegends -> BarLegend[{"BlueGreenYellow", {0, 1}}],
Contours -> {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9},
DataRange -> {{0, 1}, {0, 1}}]

ContourPlot[maxp[a, b, 0, 0.05], {a, 0, 0.96}, {b, 0, 0.96},
ColorFunction -> (ColorData["BlueGreenYellow"]),  FrameLabel -> {a, b},
PlotLegends -> BarLegend[{"BlueGreenYellow", {0, 1}}],
Contours -> {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}]


And the figure generated by ListContourPlot:

the figure generated by ContourPlot:

Looks like two figures are flipped. Why does that happen?

• It is iteration inside Table that flipped the data. Swap iterators a and b like Table[maxp[a, b, 0, 0.05], {b, 0, 0.96, 0.02}, {a, 0, 0.96, 0.02}] and the plots will be the same. Commented Aug 31, 2022 at 20:38
• Thanks! That makes sense now. Commented Sep 4, 2022 at 1:06

## 1 Answer

For ListContourPlot,we need to use Transpose the data.

ListContourPlot[
Transpose@
Table[maxp[a, b, 0, 0.05], {a, 0, 0.96, 0.02}, {b, 0, 0.96, 0.02}],
ColorFunction -> (ColorData["BlueGreenYellow"]),
FrameLabel -> {a, b},
PlotLegends -> BarLegend[{"BlueGreenYellow", {0, 1}}],
Contours -> {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9},
DataRange -> {{0, 1}, {0, 1}}]


• Not a good way of doing it, especially for big data. No need to transpose anything if you construct the table the right way in the first place. Commented Sep 1, 2022 at 7:47