Hello! How can i delete a line from my figure?
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Stany Stone
am 28 Dez. 2019
Kommentiert: Stany Stone
am 30 Dez. 2019
Hello! I have an image from which i would like to delete a line. How can i do that? When i use the delete() function it does not work. There is no error mentioned nor is the image changing.
Please help!
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 28 Dez. 2019
This should work
hLine = line(x, y, 'Color', 'r', 'LineWidth', 2);
% Now delete it.
delete(hLine);
9 Kommentare
Walter Roberson
am 29 Dez. 2019
Yes, recording the handle will always be a better solution rather than findobj when it can be done. Sometimes though you are wanting to delete a line from a plot created by code you do not have control of, or from a stored fig that you cannot change the generation code for, and in those cases you would use findobj or findall
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!