필터 지우기
필터 지우기

How to solve surface plot viewing issue?

조회 수: 2 (최근 30일)
Subhodh Sharma
Subhodh Sharma 2021년 9월 27일
답변: Star Strider 2021년 9월 27일
I have plotted a data of dimension 20*86 using the surface command. You can see the highlighted zone where the x=4 and Y=10. But without this highlighted zone it feels like the region is x=~20 and y=5.
Is there any way to show exactly this plot from its exact location ? (because without highlight it feels it's over x=~20 and y=5).
I would really appreciate your help.

답변 (1개)

Star Strider
Star Strider 2021년 9월 27일
Using an axes call could make the axis limits a bit more obvious, and to call attention to a specific point, one option is to draw a straight vertical line to it —
[X,Y,Z] = peaks(20);
F = scatteredInterpolant(X(:),Y(:),Z(:));
Zsel = F(-1, 2)
Zsel = 2.1753
figure
surf(X,Y,Z, 'FaceAlpha',0.5)
hold on
plot3([1 1]*(-1), [1 1]*2, [min(zlim) Zsel], '-k', 'LineWidth',2)
hold off
grid on
axis('tight')
xlabel('x')
ylabel('y')
view(-120,30)
Adding a text object is also an option.
Experiment to get different results.
.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by