Delete points selected on a plot
47 次查看(过去 30 天)
显示 更早的评论
Is it possible to select a point on a plot and then delete that point from the original data source? For example in the attached image i'd like to be able to select 1 of the 3 asterisk points in red and then delete them from their source.
I thought about using ginput to select the points and then delete the corresponding point in the source array, but ginput allows you to click any point on the plot.
Would the best solution be to use ginput and then use pdist to find the distance between the selected points and the available points and delete the closest?

2 个评论
dpb
2017-9-2
How did you determine the marked points are the ones to delete and to highlight?
As you note ginput allows to select any point; you'll have to supply whatever logic it is that accepts/rejects the user's selection depending on just what it is that is the intent in doing so.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!