我想在同一张图上绘制一个三维散点图和一个曲面图,最终效果如下图所示:
我认为下面的代码可以实现我的需求,但显然没有成功。我有
有什么想法吗?谢谢。
![enter image description here](https://istack.dev59.com/ZceOS.webp)
x
、y
和z
数据要绘制一个scatter3
:x = [1 1 1 1 0.95 0.95 0.95 0.95 0.85 0.85 0.85 0.85 0.8 0.8 0.8 0.8 0.75 0.75 0.75 0.75]';
y = [0.3 0.2 0.15 0.1 0.3 0.2 0.15 0.1 0.3 0.2 0.15 0.1 0.3 0.2 0.15 0.1 0.3 0.2 0.15 0.1]';
z = [0.1 0.15 0.2 0.3 0.1 0.15 0.2 0.3 0.1 0.15 0.2 0.3 0.1 0.15 0.2 0.3 0.1 0.15 0.2 0.3]';
scatter3(x,y,z)
hold on
现在添加一个表面吗?
p = [x y z];
surf(p)
有什么想法吗?谢谢。