필터 지우기
필터 지우기

Default Figure Fonts

조회 수: 529 (최근 30일)
Bill Wellman
Bill Wellman 2012년 2월 8일
편집: Cedric 2013년 10월 5일
How do I set the default font for figures to Ariel, instead of Helvetica? I have tried "set(0,'DefaultTextFontName','Ariel')" but it does not change the title or axis labels. I also tried "set(0,'DefaultFigureFontName')", and got an error. ------ Thanks, all. At Jan's suggestion, I added "set(0,'DefaultAxesFontName','Arial') to the start of my code, and it did what I wanted: set the title, axis labels, tic labels, and legend all to Arial on all figures. I also corrected my spelling at Razvan's suggestion, but that alone did not work; apparently Matlab is smart enough to recognize that error, for it already used Arial for text blocks in my figures.
  댓글 수: 1
Jan
Jan 2012년 2월 8일
Whenever you writein the forum, that you get an error, copy the error message also.

댓글을 달려면 로그인하십시오.

채택된 답변

Razvan
Razvan 2012년 2월 8일
The font name is 'Arial' not 'Ariel'...
You can change the font by
set(gca, 'FontName', 'Arial')
On one of the Matlab help page says: Note that MATLAB does not display the x-, y-, and z-axis labels in a new font until you manually reset them (by setting the XLabel, YLabel, and ZLabel properties or by using the xlabel, ylabel, or zlabel command). Tick mark labels change immediately.
So for the labels you need to put the x/ylabel commands after you change the font to arial.
Best, Razvan

추가 답변 (1개)

Jan
Jan 2012년 2월 8일
The following properties can be defined as defaults:
'defaultUicontrolFontName'
'defaultUitableFontName'
'defaultAxesFontName'
'defaultTextFontName'
'defaultUipanelFontName'
The figures do not have a FontName property. What exactly are the "figure labels"?
  댓글 수: 1
Bill Wellman
Bill Wellman 2012년 2월 9일
Thanks for the knowledgeable help. I clicked "accept", but got no response. I did edit my question, but might better have continued the blog here. I'm a Neophyte to this QA site.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by