Legend on MATLAB FIGURES

조회 수: 12 (최근 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 CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by