我想使用多边形选择数据。我知道 roipoly 这样做是为了“图像”。散点图有这样的东西吗?
问问题
1937 次
1 回答
4
您可以使用数据刷亮在散点图上标记数据,然后将其提取到工作区。寻找图形窗口顶部的小刷子符号。
请参阅Marking up graphs with Data Brushing from Matlab 和Accessing plot brushed data from the very useful Undocumented Matlab。
如果要绘制复杂的多边形,可以使用 impoly 和 inpoly:
X = rand(200, 2);
scatter(X(:,1), X(:,2));
h = impoly();
% now you go and position the polygon, control returns once you've 'finsished' with it '
nodes = getPosition(h);
selected_indices = inpoly(X, nodes);
于 2012-02-17T00:24:37.340 回答