This post is intended for people having trouble getting their font sizes to change when making plots in MATLAB. I spent about 3 hours trying to figure this out, and just did courtesy of these people:
View their solution, or see the steps below. The solution will fix the following problem:
Suppose you are trying to set the font size of the axes on your graph. You type:
set(gca, ‘FontSize’, 20)
But for some reason the font stays stubbornly at 10, or 12, or whatever. You then edit your startup.m file to set the default size when Matlab starts up. You type the following line:
You restart Matlab, and the axes are still not showing up with 20 point font.
Here’s the steps to fix this problem:
1. Open MATLAB and type “userpath”.
2. In the first directory shown, create a text file called “startup.m”, or, if it is already there, open it for editing. More detailed instructions and explanations of startup.m and userpath are here:
3. Write the following lines in startup.m:
Keep in mind you can change “Arial” to any font name that exists in Matlab. The point is to change the default font that Matlab uses. Apparently there is a bug in Matlab where the default font makes it impossible to change the font properties. I am not sure why this is the case but it certainly wasted a bunch of my time in trying to get around it.