# Strange behaviors with ListContourPlot and ContourPlot: rotation relationship

Here is an example in ListContourPlot

ListContourPlot[Table[Sin[i + j^2], {i, 0, Pi, 0.1}, {j, 0, Pi, 0.1}], DataRange -> {{0, Pi}, {0, Pi}}]


Now, we only plot the contour for a specific value with ContourPlot, say, 0.6

ContourPlot[Sin[i + j^2] == 0.6, {i, 0, Pi}, {j, 0, Pi}]


The two commands yield left and right figures, respectively.

It can be found that they will become consistent after flipping the later with respect to its left-up to right-down diagonal.

My question is how can we get a consistent figure with ContourPlot in the sense of the contour shape. It will be much better if someone could explain the strange behaviors with ListContourPlot and ContourPlot. Thank you in advance.

• In the Table, i is y (rows) and j is x (columns). In the other plot, i is x and j is y. It's just like this because when you construct matrices (rank 2 lists) you're actually building lists of lists. Jul 5, 2020 at 15:36
• The documentation for ListContourPlot states that "ListContourPlot[array] arranges successive rows of array up the page, and successive columns across." Since in your ContourPlot the "up the page" axis is the j axis, to get the same result with ListContourPlot, the rows, i.e., first index in Table, must be the j variable. Jul 5, 2020 at 15:59
• @BobHanlon thank you for your reply. Well, for DataRange -> {{range1}, {range2}} in ListContourPlot, do {range1} and {range2} correspond to "across the page" and "up the page", respectively? I have read the documentation, it seemes no explanation on this. Jul 6, 2020 at 2:42
• @user55777 - Yes. Look at ListContourPlot[ Table[i + j, {i, 0, 5, 0.1}, {j, 0, 10, 0.1}], DataRange -> {{0, 10}, {0, 5}}] to verify. Jul 6, 2020 at 3:01
• @BobHanlon thank you, sir. Jul 6, 2020 at 3:17

Change the order of iterators in ContourPlot:
cp = ContourPlot[Sin[i + j^2] == 0.6, {j, 0, Pi}, {i, 0, Pi},

Show[ListContourPlot[Table[Sin[i + j^2], {i, 0, Pi, 0.1}, {j, 0, Pi, 0.1}],