Simple 2D plot; Any way I can use String for xtick?
Ältere Kommentare anzeigen
I am going to put four ticks on horizontal axis such as
t=1:1:4
However, actually, each number implies scenarios. So, instead of using that, I'd like to use such as
t=['Scenario1', 'Scenario2', 'Scenario3','Scenario4'];
y=[33 55 66 77];
plot(t,y)
However, as expected, the result shows an error message saying that t is not going to be converted to number.
Is there any way I can put these strings as x tick?
Akzeptierte Antwort
Weitere Antworten (1)
Joon Jeon
am 21 Mär. 2012
Kategorien
Mehr zu Grid Lines, Tick Values, and Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!