MATLAB: X-axis definition

axis definitionbarplot

Hello,
Another question..
I created a barplot with the command
bar(Duration)
with Duration being a 6×3 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!

Best Answer

set(gca,'XTickLabel',names2)