How to get brushed data point index from Plot?
20 次查看(过去 30 天)
显示 更早的评论
The following linked post was incredibly helpful for me but I would like to know how to obtain the indicies of the brushed data. I'm not sure why, but the size of Pos and the size of brush are different. I want to obtain the indicies in Pos of the brushed data. Thank you.
Handle = plot3(Pos(:,1),Pos(:,2),Pos(:,3), 'o');
axis equal;
view(0,90)
brush on
Select the required data and run the following to get the brushed points:
xd = get(Handle, 'XData');
yd = get(Handle, 'YData');
zd = get(Handle, 'ZData');
brush = get(Handle, 'BrushData');
brushed_x = xd(logical(brush));
brushed_y = yd(logical(brush));
brushed_z = zd(logical(brush));
figure, plot3(brushed_x, brushed_y, brushed_z, 'o');
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!