【问题标题】:Draw only the border of scatter plot in Matlab在Matlab中只绘制散点图的边界
【发布时间】:2017-04-03 18:45:14
【问题描述】:

我在 Matlab 中有一堆二维向量。如果我使用 scatter 在二维空间中绘制它们,它们会填充一个非凸区域。有没有办法只画区域的边界?我尝试过hist 加上contourconvex hull,但他们没有完成这项工作。

【问题讨论】:

标签: matlab scatter-plot


【解决方案1】:

来自 matlab 帮助:

x = gallery('uniformdata',[10,1],0);
y = gallery('uniformdata',[10,1],1);
DT = delaunayTriangulation(x,y);
k = convexHull(DT)
figure
plot(DT.Points(:,1),DT.Points(:,2), '.','markersize',10);
hold on
plot(DT.Points(k,1),DT.Points(k,2),'r') 
hold off

【讨论】:

    猜你喜欢
    • 2022-01-02
    • 2011-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-26
    • 1970-01-01
    • 2012-10-11
    相关资源
    最近更新 更多