How to put string on the x axes and plot more than 1 graph?

2 次查看(过去 30 天)
Hello everyone, I get a problem to plot 4 graph in 1 figure and x axes must be string like this :
x axes y1 y2 y3 y4
A 1 2 3 4
B 3 4 1 2
C 4 1 2 3
D 2 3 4 1
Thankyou for the answer .
  1 个评论
Walter Roberson
Walter Roberson 2013-9-29
Are you sure you are constructing a plot and not a table?
Or are you saying that what should be associated with the first trickmark on the x axis is the string
x axes
A
B
C
D
all as one unit?

请先登录,再进行评论。

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-9-29
a=[ 1 2 3 4
3 4 1 2
4 1 2 3
2 3 4 1]
plot(a)
set(gca,'xtick',1:4,'xticklabel',{'A','B','C','D'})

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by