Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Indri Djon Hansemit
Indri Djon Hansemit le 29 Sep 2013
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 commentaire
Walter Roberson
Walter Roberson le 29 Sep 2013
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?

Connectez-vous pour commenter.

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 29 Sep 2013
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'})

Community Treasure Hunt

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

Start Hunting!

Translated by