rotate figure by transposing matrix in contourf problem

6 ビュー (過去 30 日間)
Yu Li
Yu Li 2018 年 8 月 21 日
コメント済み: Yu Li 2018 年 8 月 21 日
Hi: I want to rotate the contour plot by transposing the matrix. but the potted figures are observed to be the same. I'm not sure there is any problem with my code. Could anyone give me some suggestions?
code is below:
load new_X
load new_Y
load new_Z
figure(1)
[xc,yc]=contourf(new_X,new_Y,new_Z);
axis equal
figure(2)
[xc,yc]=contourf(new_X',new_Y',new_Z');
axis equal
Thanks! Yu

採用された回答

jonas
jonas 2018 年 8 月 21 日
編集済み: jonas 2018 年 8 月 21 日
Transposing every matrix does not change anything. If you throw two matrices X & Y as input, then the coordinates for each Z-value is obtained from those matrices, i.e. Z(1,1) is plotted at [X(1,1) Y(1,1)]. If you transpose each matrix, then the coordinates for each Z remains the same. If you are instead throw only the Z matrix as input to contourf, then transposing it works because the Z-values are plotted against their index, i.e. Z(1,1) is plotted at [1 1].
I suppose this is what you are trying to do:
[xc,yc]=contourf(new_Y,new_X,new_Z);
  1 件のコメント
Yu Li
Yu Li 2018 年 8 月 21 日
Thank you very much. The problem was solved.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by