plot of a string vector vs numeric vector
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I wonder how to make a plot as X-axis is a text vector. I get an error when I run the folloing code (??? Error using ==> plot Invalid first data argument). I apperciate your help.
y=[1 2 3 4 5 6]
x=['a','b','c','d','e','f']
plot(x,y)
1 commentaire
Réponse acceptée
Matt Fig
le 24 Juin 2011
y=[1 2 3 4 5 6]
x=['a','b','c','d','e','f']
plot(y)
set(gca,'xticklabel',x.')
2 commentaires
Christine Abou Nasr
le 13 Avr 2017
Hello! and if I want to select just a part of the x table, how can I do? For example, I would like to plot x values 'b' to 'e'. Thank you!
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!