changing font size in all the elements of figures

456 ビュー (過去 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 Center および File ExchangeGraphics Object Properties についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by