Hi all,
I have a set of x,y,z data as follows:
x =
0.1 0.31623 1 3.1623 10
y =
-1 -0.75 -0.5 -0.25 0 0.25 0.5 0.75 1
z =
0.36602 0.1774 0.18262 0.22931 0.23142
0.35639 0.28053 0.26868 0.26152 0.22932
0.41203 0.36037 0.3113 0.26592 0.21948
0.42282 0.36818 0.30538 0.25642 0.20567
0.34572 0.31703 0.28316 0.24251 0.19116
0.28834 0.28187 0.26377 0.2291 0.17855
0.27488 0.26436 0.24923 0.21842 0.16904
0.25749 0.25185 0.23936 0.21088 0.16254
0.24742 0.24423 0.23309 0.20598 0.15839
I plot a surface using this:
K>> surf(x, y, eSurf)
K>> view(2)
Matlab gives me this plot:
we can see that the blocks are rectangular but the entire plot is square, is there a way to make the blocks square but the plot rectangular?
Many thanks!

 採用された回答

Walter Roberson
Walter Roberson 2018 年 6 月 2 日

0 投票

pcolor(x, y, z)
set(gca, 'XScale', 'log', 'dataaspectratio', [10 1 1])

3 件のコメント

Xiaohan Du
Xiaohan Du 2018 年 6 月 2 日
Thanks Walter, this solved my problem. However if I rotate the plot, it is a flat surface (different from the original surface), is there a way to be able to maintain the original surface while using square blocks?
Walter Roberson
Walter Roberson 2018 年 6 月 2 日
You can use surf(x,y,z); view(2) instead of pcolor(x,y,z)
Xiaohan Du
Xiaohan Du 2018 年 6 月 2 日
Oh yes, thanks a lot!

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

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by