一起使用plot3
和surf
的小技巧。我使用白色表面来隐藏不需要的线条:
%Data generation
[X,Y,Z] = peaks(50);
%First we plot the surface
h = surf(X,Y,Z);
%We change the view (optionnal)
view(45,30);
%The plot become white
colormap([1,1,1])
h.EdgeColor = 'None';
%And now we plot our 3D lines.
hold on
plot3(X,Y,Z,'b');
<强>结果:强>