How can I make bigger the names plotted in the X axis from a variable?

1 回表示 (過去 30 日間)
flashpode
flashpode 2022 年 5 月 12 日
コメント済み: Jan 2022 年 5 月 12 日
so I want to mae the names of the Variable T bigger so that I can read it clearly. How can I do it? Here is my code:
T = ["juny AIS1" "juny AIS2" "març AIS1" "març AIS2" "octubre AIS1" "octubre AIS2"];
format shortG
C = [NmeanJuny,PmeanJuny, NmeanMars,PmeanMars, NmeanOct,PmeanOct];
T=categorical(T); % turn into categorical variable
colors = get(gca(),'ColorOrder');
cdata = colors(ones(numel(T),1),:);
cdata([2 4 6],:) = [ ...
1 0 0; ...
1 0 0; ...
1 0 0];
b = bar(T,C,'FaceColor','flat','CData',cdata);
text(1:length(C),C,num2str(round(C')),'vert','bottom','horiz','center','FontSize',16);
ylabel('Missatges erronis')
title('Mitja mensual de missatges erronis')
box off
Thank you In advance!!

採用された回答

Subhodh Sharma
Subhodh Sharma 2022 年 5 月 12 日
編集済み: Subhodh Sharma 2022 年 5 月 12 日
Just increase the xticklable size..
dx=18
b = get(gca,'XTickLabel');
set(gca,'XTickLabel',b,'fontsize',dx)
Increase the fontsize with dx. Hope it works.
  2 件のコメント
flashpode
flashpode 2022 年 5 月 12 日
Thats great Thanks
Jan
Jan 2022 年 5 月 12 日
@Subhodh Sharma: You can omit to set the handle of the XTickLabels to the handle of the XTickLabels. Simpler:
dx = 18;
set(gca, 'fontsize', dx);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by