x-axis definition

2 ビュー (過去 30 日間)
Inti Vanmechelen
Inti Vanmechelen 2015 年 12 月 21 日
コメント済み: Inti Vanmechelen 2015 年 12 月 22 日
Hello,
Another question..
I created a barplot with the command
bar(Duration)
with Duration being a 6x3 matrix. Because the matrix has 6 rows, my stacked bars are called 1, 2, 3, ...6.
I want to change this to the name of 6 muscles. I used axis({names2}), with names2 being a cellary containing the 6 muscle names.
This doesn't work because matlab doens't recognize the cellary while it's in my workspace.
Anyone who can tell me what would be right input?
Thank you!
  2 件のコメント
Jan
Jan 2015 年 12 月 21 日
If you get an error message, please post it completely. Why do you assume that the axis command is useful to set the names?
Inti Vanmechelen
Inti Vanmechelen 2015 年 12 月 22 日
This is the code:
bar(Duration);
axis(names2);
ylabel('Percentage of stance phase');
title('Duration of muscle activity during stance');
Matlab gives me this error:
Error using message In 'MATLAB:axis:UnknownOption', data type supplied is incorrect for parameter {1}.
Error in axis (line 176) error(message('MATLAB:axis:UnknownOption', cur_arg));

サインインしてコメントする。

採用された回答

the cyclist
the cyclist 2015 年 12 月 21 日
編集済み: the cyclist 2015 年 12 月 21 日
set(gca,'XTickLabel',names2)
  1 件のコメント
Inti Vanmechelen
Inti Vanmechelen 2015 年 12 月 21 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by