How to change the font size of xtick and ytick with scientific notation on the side?
15 views (last 30 days)
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);
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?
dpb on 10 Aug 2022
>> hAx.FontName='Times New Roman';
seems to work just fine here...
I don't see anything specifically wrong in the posted code snippet but it's not necessary to reset the text to change the other properties.
You sure you didn't do anything else besides???
I have R2020b installed here, but I'd be very surprised if there were any warts in this area in R2018b; I've been updating usually a year or two behind since the beginning of time and have no recollection of the above not working as expected in any release.