Words as x axis?

43 次查看(过去 30 天)
Monica Rochnowski
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!

采纳的回答

BN
BN 2020-2-1
编辑:BN 2020-2-1
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)
Further, you can read Label x-axis.
If you want to rotate Words after doing this, as I can predict, it you can read this documentation: xtickangle
  4 个评论
Star Strider
Star Strider 2020-2-1
No worries!
Monica Rochnowski
You guys are both awesome! Thank you so much!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by