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