필터 지우기
필터 지우기

How to clear only a part of the plot

조회 수: 131 (최근 30일)
Sonima
Sonima 2018년 7월 26일
편집: Stephen23 2018년 7월 26일
Hi! I have a figure with multi lines plotted in different steps. plot(a); hold on; plot(b); plot(c); plot(d);
I want to clear only the some of the plots and hold the rest.
delete plot(a) and plot(c)
cfl will remove all. Any solution to this? thanks.

채택된 답변

KSSV
KSSV 2018년 7월 26일
figure
hold on
h1 = plot(rand(10,1)) ;
h2 = plot(rand(10,1)) ;
h3 = plot(rand(10,1)) ;
h4 = plot(rand(10,1)) ;
set(h2,'Visible','off')
set(h4,'Visible','off')
  댓글 수: 1
Stephen23
Stephen23 2018년 7월 26일
편집: Stephen23 2018년 7월 26일
This does not clear them from the plot, just makes the lines not visible.

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

추가 답변 (1개)

Stephen23
Stephen23 2018년 7월 26일
편집: Stephen23 2018년 7월 26일
This will actually delete the line objects from the axes:
ah = plot(...);
hold on
bh = plot(...);
ch = plot(...);
delete(ah)
delete(ch)

카테고리

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