I'm currently trying to create a script that can automatically format all of my plots for me. I'm encountering a weird issue in trying to set the font size for the XLabel and YLabel.
To demonstrate this problem.
s = tf('s');
H = 1/(s+1);
h = xlabel("Time", "FontSize", 20);
Text (time (seconds)) with properties:
Color: [0 0 0]
Position: [223 -20.6667 0]
So far, everything works and we can print out h and see that it has the correct font size.
However, if we look at the font size property using gca, it doesn't work.
ax = gca;
Text with properties:
Color: [0.4000 0.4000 0.4000]
Position: [4.5000 -0.0744 -10]
Then, if we use gca to set the XLabel, another label pops up. It seems like there are two separate XLabel properties within the plot.
ax.XLabel.String = "hello";
I tried to replicate this problem with plot(), but that function works fine. Maybe this is unique to step(). I haven't tested with other plotting functions. Any advice on what to do if I want to automate formatting all my plots using gca?