I have followed this thread to come up with X-axis labels for my graph. However, I want Matlab to treat the labels as tex code. In other words, when I have K_1, I want Matlab to display it as K subscript 1. How can I do that?
This is a bit ugly solution, but still...
You can remove the ticks and add text elements manually:
x = 1:5;
y = x.*x;
plot(x, y, 'b')
set(gca, 'XTick',[]);
text(1,-0.8,'A_1');
text(2,-0.8,'B_1');
text(3,-0.8,'C_1');
text(4,-0.8,'D_1');
text(5,-0.8,'E_1');

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With