hiding legend in plot
古いコメントを表示
Dear All,
I want to hide one legend from my graph. Could you please suggest a procedure or steps to do it.
Here is the code below to hiding my legend but doesn't work.
legend(h4,'off')
legend(h4,'toggle')
legend('h1','h2', 'h3', 'h4','h5');
Many Thanks in advance
Babai
採用された回答
その他の回答 (2 件)
Sean de Wolski
2012 年 12 月 4 日
Get the handle form the legend when you create it
hLeg = legend('example')
Then turn its visibility off
set(hLeg,'visible','off')
1 件のコメント
Nirjhar Kumar
2019 年 4 月 1 日
編集済み: Nirjhar Kumar
2019 年 4 月 1 日
in case you dont have the any handle:
hFig=findall(0,'type','figure');
hLeg=findobj(hFig(1,1),'type','legend');
set(hLeg,'visible','off')
Sayanta
2012 年 12 月 5 日
2 投票
2 件のコメント
Payam Nia
2015 年 9 月 24 日
b = gca; legend(b,'off');
Marco A. Acevedo Z.
2023 年 5 月 8 日
thanks Payam.
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!