x-axis definition

조회 수: 8 (최근 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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by