How to change the font size of xtick and ytick with scientific notation on the side?
古いコメントを表示
xticklabel_fs = get(gca,'XTickLabel');
set(gca, 'XTickLabel', xticklabel_fs, 'FontName', 'Times New Roman', 'fontsize', 12);
yticklabel_fs = get(gca,'YTickLabel');
set(gca, 'YTickLabel', yticklabel_fs, 'FontName', 'Times New Roman', 'fontsize', 12);
Origin:

After applying the above code:

Can anyone tell me what to do with it?
After applying the above code, the font size is enlarged but the scientific notation disappear?
採用された回答
その他の回答 (1 件)
Walter Roberson
2022 年 8 月 10 日
0 投票
Scientific notation is always disabled when you supply your own tick labels. Scientific notation is only for automatic labeling.
2 件のコメント
haohaoxuexi1
2022 年 8 月 10 日
dpb
2022 年 8 月 10 日
Good point, Walter. I'd not thought about that nuance in writing tick labels that disconnects them from the tick values also triggering the change in formatting; just knew it wasn't needed for what OP wanted.
カテゴリ
ヘルプ センター および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!