Reputation: 2985
I recently started doing some prototyping using MATLAB. I like to make my axises in latex font because it is consistent with the rest of my writing. I used the following code:
figure()
plot(t, y(:, 1), t, y1, '--r')
legend('Transfer Function', 'State Space', 'Interpreter', 'latex');
xlabel('Time, \textit{t} (s)', 'Interpreter', 'latex');
ylabel('%MeOH in Distillate, \textit{X_D} (%)', 'Interpreter', 'latex');
By doing so, I got my x-axis and legend in latex format. However, my y-axis was not in latex format.. I am wondering why this is.
Thanks!
Upvotes: 0
Views: 158
Reputation: 19689
You have messed up some LaTeX syntax. See the highlighted changes:
ylabel('\%MeOH in Distillate, \textit{$X_D$} (\%)', 'Interpreter', 'latex');
% ^ ^ ^ ^
Upvotes: 3