Delete points selected on a plot

74 ビュー (過去 30 日間)
Luke C
Luke C 2017 年 9 月 2 日
コメント済み: Star Rats 2019 年 10 月 9 日
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
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.
Luke C
Luke C 2017 年 9 月 2 日
The marked points are determined by finding local minima/maxima along the boundary. The need to be able to select and delete points is because the boundaries can occasionally have turns along them resulting in a point being marked, where only corners are required.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2017 年 9 月 2 日
  2 件のコメント
Luke C
Luke C 2017 年 9 月 2 日
Thanks I think this combined with data linking is exactly what I need.
Star Rats
Star Rats 2019 年 10 月 9 日
This is absolutely what I need. Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Exploration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by