How to make axes have proportional scales?
이전 댓글 표시
Hi, I would like the x and y axes on my surf plot to have proportional scales. I am plotting temperature over a 2D plane. I want to visualise the temperature profile but the x and y axes stretch to fit the figure window, stretching the temperature profile.
I want the axes to have the same 'unit:distance on screen' ratio. How can I do this? I have been finding the aspect ratio help not very helpful Thanks
채택된 답변
추가 답변 (2개)
karipuff
2019년 11월 13일
1 개 추천
daspect([1 1 1])
댓글 수: 1
Walter Roberson
2019년 11월 13일
Yes, this is another way to set the axes dataaspect property
Ermanno Manca
2020년 6월 23일
0 개 추천
Hi, i'm using Matlab App Designer.
Unfortunately i have the same problem. But by typing "set(gca,'DataAspectRatio',[10 1 1])" it opens a figure instead of changing the axis scale in my app.UIAxis plot.
How can i have the same scale for x and y axis in my app.UIAxis plot?
Thanks a lot
댓글 수: 3
Walter Roberson
2020년 6월 23일
gca() appears to work only with traditional figures. Use the explicit handle to the axes instead.
app.MyAxes1.DataAspectRatio = [1 1 1]
or
axis(app.MyAxes1, 'equal')
Ermanno Manca
2020년 6월 24일
Hey thanks, axis(app.MyAxes1, 'equal') didn't work for me.
I didn't try app.MyAxes1.DataAspectRatio = [1 1 1] but i guess it'll work too.
I found set(app.MyAxes1,'DataAspectRatio',[1 1 1]) so that worked out too.
Thanks for your help and your wuick response!
Jonahtan González
2021년 1월 19일
카테고리
도움말 센터 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

