How to change the font size of xtick and ytick with scientific notation on the side?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 10 Août 2022
0 votes
Scientific notation is always disabled when you supply your own tick labels. Scientific notation is only for automatic labeling.
2 commentaires
haohaoxuexi1
le 10 Août 2022
dpb
le 10 Août 2022
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.
Catégories
En savoir plus sur Axis Labels dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!