Legend on MATLAB FIGURES

13 ビュー (過去 30 日間)
Bran
Bran 2015 年 7 月 6 日
回答済み: Sid 2015 年 7 月 7 日
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?

回答 (3 件)

Thorsten
Thorsten 2015 年 7 月 6 日
h = legend(... % your code here
set(h, 'FontSize', 8); % reduce font size used in legend
  2 件のコメント
Bran
Bran 2015 年 7 月 6 日
Is there any way to do this on the actual figure, if you have it already saved
Thorsten
Thorsten 2015 年 7 月 7 日
編集済み: Thorsten 2015 年 7 月 7 日
No, I don't think so.

サインインしてコメントする。


Azzi Abdelmalek
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
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)

サインインしてコメントする。


Sid
Sid 2015 年 7 月 7 日
Perhaps it's a bit out of scope for this topic, but since you mentioned about figures being saved, thought I suggest export_fig at FEX (Link here .)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by