【问题标题】:Fill the area under curve in matlab plot3在matlab plot3中填充曲线下的区域
【发布时间】:2016-10-25 15:33:31
【问题描述】:

我有这样的情节:

我需要曲线下的区域是白色的(峰不透明)。这是由plot3 完成的。有没有办法例如为这样的目的使用fill3?我问是因为我认为这一定已经解决了。

【问题讨论】:

  • 试试surf而不是plot3
  • 遗憾的是,我只需要一维网格。
  • 你的数据是什么形式的(或者给出一些示例数据?)
  • 每片,你可以做fill3([x,x(1)],[y,y(1)],[z,z(1)],'w');。尽管这会在补丁底部产生一条线,但我不知道如何删除。

标签: matlab plot


【解决方案1】:

同时使用plot3surf 的小技巧。我使用白色表面来隐藏不需要的线条:

%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');

结果:

【讨论】:

    猜你喜欢
    • 2011-12-15
    • 2020-07-02
    • 2018-11-01
    • 2021-12-23
    • 2016-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多