How to change the font size of xtick and ytick with scientific notation on the side?
Mostra commenti meno recenti
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?
Risposta accettata
Più risposte (1)
Walter Roberson
il 10 Ago 2022
0 voti
Scientific notation is always disabled when you supply your own tick labels. Scientific notation is only for automatic labeling.
2 Commenti
haohaoxuexi1
il 10 Ago 2022
dpb
il 10 Ago 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.
Categorie
Scopri di più su Axis Labels in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!