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

Answers (0)

Categories

Asked:

on 23 Apr 2014

Community Treasure Hunt

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

Start Hunting!