필터 지우기
필터 지우기

Hello! How can i delete a line from my figure?

조회 수: 20 (최근 30일)
Stany Stone
Stany Stone 2019년 12월 28일
댓글: Stany Stone 2019년 12월 30일
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!

채택된 답변

Image Analyst
Image Analyst 2019년 12월 28일
This should work
hLine = line(x, y, 'Color', 'r', 'LineWidth', 2);
% Now delete it.
delete(hLine);
  댓글 수: 9
Walter Roberson
Walter Roberson 2019년 12월 29일
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
Stany Stone
Stany Stone 2019년 12월 30일
Thnak you so much for your answears!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by