changing font size in all the elements of figures

조회 수: 451 (최근 30일)
hamza hamza
hamza hamza 2015년 6월 10일
댓글: Bhanu Vardhan 2023년 7월 6일
Hello, i want to make bigger all the text in a figure ( title, xlabel, axis,....), so i wrote this line of code in the beginning of the script: set(0,'defaulttextfontsize',30) but it doesn't change anything at all. Could you help me please, how can i change the font size? thank you
  댓글 수: 2
Rong Yu
Rong Yu 2015년 6월 10일
Try this
set(gca,'FontSize',30)
Bhanu Vardhan
Bhanu Vardhan 2023년 7월 6일
Works for me. Thanks!

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

답변 (3개)

onewhaleid
onewhaleid 2015년 6월 11일
편집: onewhaleid 2015년 6월 11일
I use findall to change the font size for all text in a single figure:
set(findall(gcf,'-property','FontSize'),'FontSize',12)
  댓글 수: 4
Walter Roberson
Walter Roberson 2017년 10월 3일
DefaultAxesFontSize is a better programming practice, but when you use set() the property names are not case sensitive.
set(0,'defaultaxisfontsize',30) or set(0, 'DefaultAxesFontSize', 30) only works for axes text created after the call to set(); it does not change the size for any existing text object, which the findall() version does change.
David Franco
David Franco 2018년 4월 26일
Works perfectly @onewhaleid. Thanks! +1

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


Walter Roberson
Walter Roberson 2015년 6월 11일

Sunisa Prasopporn
Sunisa Prasopporn 2023년 2월 2일
편집: Sunisa Prasopporn 2023년 2월 2일
I would like to change 'FontSize' in clustergram heatmap. How should write the coding.

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by