clear one plot in multiple (hold) figure
이전 댓글 표시
I have a single figure/plot that contains multiple plots commands (not subplots - just multiple data sets). I need to be able to add the data to the current figure, see how it looks, and clear it if doesnt fit my visual criteria.
Any suggestions?
clf clears the entire figure. I just want to clear the last data set I added to the figure.
채택된 답변
추가 답변 (3개)
Matt Tearle
2011년 2월 16일
In addition to the cyclist's answer, you can also do
delete(h2)
to actually delete the line, rather than just hide it. Also, if you didn't store the handles on plotting ( h1 = plot(...) ) you can find them after the fact using findobj
h = findobj('type','line')
finds a vector of handles to all line objects. You could then delete(h(1))
댓글 수: 3
Jiro Doke
2011년 2월 27일
Another option (if you don't have the handle), is to click on the line that you want to delete and type:
delete(gco)
Wencai Lee
2011년 4월 6일
Hi Jiro,
Do you know how to undo one step after using the delete(gco)?
Thanks!
Eric T
2016년 3월 18일
This seems a nice, principled answer. Don't like making them invisible because that takes up memory, def prefer to delete them!
Sai
2017년 1월 18일
3 개 추천
Go to 'View' and click on the 'Plot Browser' to enable it. There you can check/uncheck the plots in the figure
Ashton
2011년 2월 16일
1 개 추천
댓글 수: 1
Matt Tearle
2011년 2월 16일
You're welcome. And now the obligatory message: to help others who might have the same question, it would be great if you could vote for and/or accept answers that you think should be given prominence. Thanks. (I know there's only a couple of answers in this case, but it's good practice to let everyone know "answer X solved my problem")
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!