How to set the xy blocks in SURF plot as squares?

조회 수: 4 (최근 30일)
Xiaohan Du
Xiaohan Du 2018년 6월 2일
댓글: Xiaohan Du 2018년 6월 2일
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일
pcolor(x, y, z)
set(gca, 'XScale', 'log', 'dataaspectratio', [10 1 1])
  댓글 수: 3
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개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by