Same aspect ratio for the z-axis in a surface plot
古いコメントを表示
I have a surface plot
and the x-axis and y-axis have the same ratio. I wish for the z-axis to have the same ratio. I have used
daspect ([1 1 1])
but it turns into a 2D plot.
I have used this code for the same aspect ratio for the x-axis and y-axis.
h=get(gca,'DataAspectRatio');
if h(3)==1
set(gca,'DataAspectRatio',[1 1 1/max(h(1:2))])
else
set(gca,'DataAspectRatio',[1 1 h(3)])
end
3 件のコメント
Alexandra Roxana
2023 年 6 月 9 日
移動済み: Star Strider
2023 年 6 月 9 日
Mathieu NOE
2023 年 6 月 9 日
maybe you get a 2D plot because the range of your z axis is 1000 times smaller than the range of x, y axes
Alexandra Roxana
2023 年 6 月 10 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Geographic Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





