Clearing legend in GUI plot

Hello all,
I'm working on my first GUI and I am having trouble getting the legend to clear/hide when I hide a figure. I am able to hide the axes and the data plot using 'cla' but I can't figure out how to make the legend go away.
Any thoughts would be much appreciated! -Amanda

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 21일
편집: Azzi Abdelmalek 2013년 8월 21일

6 개 추천

legend('hide')
%for your GUI it is:
legend(handles.axes1,'hide')

댓글 수: 2

chlor thanks
chlor thanks 2016년 8월 11일
This works for my question too! Thanks Azzi!
Abdurrehman
Abdurrehman 2017년 7월 13일
Jazakallah o khair dear Azizi

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

KAE
KAE 2017년 7월 18일

5 개 추천

If you instead want to delete the legend from your GUI rather than hide it,
legend(handles.axes1, 'off');

카테고리

태그

질문:

2013년 8월 21일

답변:

KAE
2017년 7월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by