查看单个帖子
旧 2019-12-10, 20:48   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
帖子 将散点图变成面积图

我在MATLAB中有一个2D散点图。是否可以对散点图进行插值以创建面积图?



回答:

如果您只是想在整个散布点周围绘制一个大的填充多边形,则可以使用函数CONVHULL查找包含点的凸包,并使用PATCH显示凸包:

x = rand(1,20); %# 20 random x values y = rand(1,20); %# 20 random y values hullPoints = convhull(x,y); %# Find the points defining the convex hull patch(x(hullPoints),y(hullPoints),'r'); %# Plot the convex hull in red hold on; %# Add to the existing plot scatter(x,y); %# Plot your scattered points (for comparison) 这是结果图:





更多&回答...
poster 当前离线   回复时引用此帖