How to solve surface plot viewing issue?

1 回表示 (過去 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 Center および File ExchangeSurface 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