plot of a string vector vs numeric vector
15 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Matt Fig
2011 年 6 月 24 日
y=[1 2 3 4 5 6]
x=['a','b','c','d','e','f']
plot(y)
set(gca,'xticklabel',x.')
2 件のコメント
Christine Abou Nasr
2017 年 4 月 13 日
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!
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!