Legend on MATLAB FIGURES
5 次查看(过去 30 天)
显示 更早的评论
I am exporting my MATLAB figures into PDF format. I have altered the size of the figures but when I do so the legend on my graph is too big for the new size. How can I make the legend smaller so it fits nicely into the new graph. Also how can I change the size of the writing. I am using export settings?
0 个评论
回答(3 个)
Thorsten
2015-7-6
h = legend(... % your code here
set(h, 'FontSize', 8); % reduce font size used in legend
Azzi Abdelmalek
2015-7-6
t=0:0.1:10;
y1=sin(t);
y2=cos(t);
plot(t,y1,t,y2);
leg={'leg1','leg2'},
hleg=legend(leg);
set(hleg,'fontsize',6)
1 个评论
Azzi Abdelmalek
2015-7-6
编辑:Azzi Abdelmalek
2015-7-6
To get the legend handle
t=0:0.1:10;
y1=sin(t);
y2=cos(t);
plot(t,y1,t,y2);
leg={'leg1','leg2'},
legend(leg);
h=findobj(gcf,'type','legend')
set(h,'fontsize',20)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!