Limit Lines/Plane on a 3D Plot

13 次查看(过去 30 天)
Sclay748
Sclay748 2021-1-20
回答: KSSV 2021-1-20
Hello, I am trying to add a limit line to my 3D plot.
If I was in 2D, I would just use xline or yline to throw a line on the graph with a label.
How would I do that for 3D? Is there a way to generate an easy plane to show my limits for all 3 axis?
Thanks!
This is what I would do if it was 2D. I need the 3D equivalent that encorporates all axis.
xline(123, 'k', 'Label1 )
yline(123, 'b', Label2)

回答(1 个)

KSSV
KSSV 2021-1-20
In 3D your (x,y) points remain same on the line and your z coordinate will vary. You can write a small function for you need.
Example
[X,Y,Z] = peaks(50) ;
n = 10 ;
x = 0 ; y = 0 ; % want line passing throuh (0,0) and parallel to z axies
P = [repmat(x,10,1) repmat(y,10,1) (0:9)'] ;
surf(X,Y,Z)
shading interp
hold on
plot3(P(:,1),P(:,2),P(:,3))

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by