Words as x axis?
45 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Monica Rochnowski
am 1 Feb. 2020
Kommentiert: Monica Rochnowski
am 1 Feb. 2020
Hello, I'm using MatLab for my cs class in college, it's an intro class and I know close to nothing about coding.
I would like to make a graph of x and y values, I understand that part, with numbers though.
My x values are i guess words instead of numbers, how do I represent that?
Thank you!
0 Kommentare
Akzeptierte Antwort
BN
am 1 Feb. 2020
Bearbeitet: BN
am 1 Feb. 2020
First, you can create Words
Words = {'word_one'; 'word_two'; 'word_three'};
then plot what ever you want, and after plot part:
set(gca,'xtick',[1:3],'xticklabel',Words)
If you want to rotate Words after doing this, as I can predict, it you can read this documentation: xtickangle
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!