contour plot does not match matrix contours

Hello,
Assume I have the following matrix:
A=[1 2 3 4;2 3 4 5;3 4 5 6;4 5 6 7]
If I create the following plots:
figure; imagesc(A)
figure; contour(A)
The displayed contour lines do not line up with the constant values in the matrix. They are rotated 90 degrees from the imagesc plot. I have attached 2 pictures to show what I mean.
However, if the matrix is:
B = [1 2 3; 1 2 3; 1 2 3]
The two types of plots will match up.
Why does the contour plot apear to rotate the constant value lines when the gradient is angled?
Thanks

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Contour Plots 的更多信息

提问:

2014-4-23

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by