Filter löschen
Filter löschen

changing font size in all the elements of figures

292 Ansichten (letzte 30 Tage)
hamza hamza
hamza hamza am 10 Jun. 2015
Kommentiert: Bhanu Vardhan am 6 Jul. 2023
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

Antworten (3)

onewhaleid
onewhaleid am 11 Jun. 2015
Bearbeitet: onewhaleid am 11 Jun. 2015
I use findall to change the font size for all text in a single figure:
set(findall(gcf,'-property','FontSize'),'FontSize',12)
  4 Kommentare
Walter Roberson
Walter Roberson am 3 Okt. 2017
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 am 26 Apr. 2018
Works perfectly @onewhaleid. Thanks! +1

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 11 Jun. 2015

Sunisa Prasopporn
Sunisa Prasopporn am 2 Feb. 2023
Bearbeitet: Sunisa Prasopporn am 2 Feb. 2023
I would like to change 'FontSize' in clustergram heatmap. How should write the coding.

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by