Borrar filtros
Borrar filtros

changing font size in all the elements of figures

300 visualizaciones (últimos 30 días)
hamza hamza
hamza hamza el 10 de Jun. de 2015
Comentada: Bhanu Vardhan el 6 de Jul. de 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
  2 comentarios
Rong Yu
Rong Yu el 10 de Jun. de 2015
Try this
set(gca,'FontSize',30)
Bhanu Vardhan
Bhanu Vardhan el 6 de Jul. de 2023
Works for me. Thanks!

Iniciar sesión para comentar.

Respuestas (3)

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

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 11 de Jun. de 2015

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

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by