Deleting legends from subplot
154 views (last 30 days)
Show older comments
I have many figures. Each figure have 2 graphs. I want to delete legends in 2 graphs.
0 Comments
Accepted Answer
Azzi Abdelmalek
on 27 Mar 2016
Edited: Azzi Abdelmalek
on 27 Mar 2016
Look at this exampe
subplot(1,2,1);
plot(1:10)
legend('aa')
subplot(1,2,2);
plot(sin(1:10))
legend('bb')
%---delete the legend-------------
s=findobj('type','legend')
delete(s)
3 Comments
RUBINEI DORNELES MACHADO
on 3 May 2020
Hi ... if you need delete specific legend in position x:
lgd.String(x)=[ ];
;)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!