How to surf very small values keeping the same ratio?

조회 수: 5 (최근 30일)
Alexandra Roxana
Alexandra Roxana 2023년 6월 11일
댓글: Torsten 2023년 6월 12일
I'm having a solution with very small values and I need to surf it; this is how a part of the solution looks like:
I'm also using the same aspect ratio and because the values are so small the surf looks like a 2D plot.
It should look as if I would take a pencil and a piece of paper and I would draw it. Is there any way to keep the same aspect ratio but not to look like in the figure? Thank you.

채택된 답변

John D'Errico
John D'Errico 2023년 6월 11일
I THINK what you are asking is how to make the surface show there is little variation in z. I'll make up an example...
[X,Y] = meshgrid(0:5,0:6);
Z = (X+Y)*1e-3;
surf(X,Y,Z)
box on
view(-60,10)
And it looks like the surface is doing something significant, when really, it is pretty boring. I'll redo the plot, then add one extra call now.
surf(X,Y,Z)
box on
axis equal
view(-60,10)
So viewed from the same angle, now we see that one of the surfaces is pretty boring, yet the first looks as if something is happening. The difference was the "axis equal" command.
  댓글 수: 2
Alexandra Roxana
Alexandra Roxana 2023년 6월 12일
편집: Alexandra Roxana 2023년 6월 12일
That's right, but the difference between the 0 and 2 on the x-axis and the difference between 0 and 0.002 on the z-axis is almost the same, which in reality isn't.
Torsten
Torsten 2023년 6월 12일
But how to escape from Flatland if you don't use this trick ? If the differences in one of the three dimensions is small, your plot will be almost 2d - that's a simple fact.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Alan Stevens
Alan Stevens 2023년 6월 11일
Multiply them all by 1e4.
  댓글 수: 4
Alexandra Roxana
Alexandra Roxana 2023년 6월 12일
And how do I do that to also keep the aspect ratio? With zlim?
Alan Stevens
Alan Stevens 2023년 6월 12일
I guess you need to use John's approach (below).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by