x-axis definition

4 views (last 30 days)
Inti Vanmechelen
Inti Vanmechelen on 21 Dec 2015
Commented: Inti Vanmechelen on 22 Dec 2015
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 Comments
Inti Vanmechelen
Inti Vanmechelen on 22 Dec 2015
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));

Sign in to comment.

Accepted Answer

the cyclist
the cyclist on 21 Dec 2015
Edited: the cyclist on 21 Dec 2015
set(gca,'XTickLabel',names2)
  1 Comment
Inti Vanmechelen
Inti Vanmechelen on 21 Dec 2015
Thank you!

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by