简体   繁体   English

在3-D表面图上绘制曲线

[英]Drawing a curve on a 3-D surface graph

I have created a surface graph in MATLAB which I have projected on to XY axis. 我在MATLAB中创建了一个曲面图,并将其投影到XY轴上。 I want to find the equation of a line that follows the yellow region in the following graph. 我想在下图中找到跟随黄色区域的直线方程。 That is I want to find the equation of a curved line like the one displayed from the black curve. 那就是我想找到一条曲线的方程,就像从黑色曲线显示的那样。
Is there a way for me to draw a curved line on this surface graph and then obtain the equation of that curve. 有没有办法让我在此曲面图上绘制一条曲线,然后获得该曲线的方程式。
If it is a line in MATLAB I think I can do it by Insert-> Line . 如果它是MATLAB中的一行,我想我可以通过Insert-> Line来做到。 Is there a similar way for me to draw a curve on the surface graph? 有没有类似的方法可以在曲面图上绘制曲线?

在此处输入图片说明

You can use contour . 您可以使用contour Note that, as per the documentation, you have to duplicate the value that defines the desired level: 请注意,根据文档,您必须复制定义所需级别的值:

x = linspace(0,pi,200);
y = linspace(0,pi/2,200);
z = bsxfun(@times, sin(x), sin(y.')); %'// example data
imagesc(z); %// plot image
hold on
value = .5; %// desired level
h = contour(z,[value value],'k'); %// plot contour for that level

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM