Highlight multiple segments in plot and save indices

1 回表示 (過去 30 日間)
jj_jft
jj_jft 2023 年 10 月 13 日
コメント済み: jj_jft 2023 年 10 月 14 日
Suppose I have multiple plots containing various data.
One such plot may be
x = linspace(0,2*pi,1000)
data = sin(2*x) + cos(5*x)
plot(data)
In the GUI, I would now like to select multiple single points or mark multiple segments of the graph, save the indices of the marked data programmatically, and then move to the next plot.
I have tried using brush, but it will only allow me to highlight a single segment. When I want to highlight the next segment, the first segment will not be marked anymore. I also looked into ginput, but it does not allow me to select actual points on the graph. I have thought about creating data tips in the GUI and then storing those, but since the plot contains a lot of points, these are hard to create for me.
Does anyone know if there is a kind of "hold on" function for the highlighting using brush or is there another way to acheive my goal?
Thank you in advance!

採用された回答

Anton Kogios
Anton Kogios 2023 年 10 月 14 日
Is this what you're after? You can select multiple segments by simply holding the Shift key, from the documentation:
  1 件のコメント
jj_jft
jj_jft 2023 年 10 月 14 日
Thanks a lot, I must have overlooked this.

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

その他の回答 (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