Is it possible to only allow brush to select data from certain lines in a plot?
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Eric Snyder
am 15 Nov. 2021
Kommentiert: Eric Snyder
am 15 Nov. 2021
I built a GUI which allows a user to select points in a plot and save them or remove them. My code is something like:
fig = figure(1);
plot(t1, x1)
hold on
plot(t2, x2)
hold off
I want the user to be able to use the brush to select points from x2, but not points from x1. Is it possible to set x1 as a background image that the user can't interact with, or somehow activate the brush only for points in x2?
0 Kommentare
Akzeptierte Antwort
Adam Danz
am 15 Nov. 2021
Bearbeitet: Adam Danz
am 15 Nov. 2021
Set HandleVisibility to off (or callback) for the graphics objects you'd like to hide from the brush tool.
Note that this will also hide the objects from other functions such as legend so you'll need to supply the handle in those cases (demo'd below).
fig = figure(1);
h1 = plot(t1, x1, 'HandleVisibility', 'off');
hold on
h2 = plot(t2, x2);
hold off
legend([h1, h2])
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!