x-labels do not show in bar3 graph

In my plot only first x-label is showing up, what's the problem?
Here's the code I have:
X={1;2;3;4;5;6;7;8;9;10;11;12;13;14;15};
Y={2;3;2;3;4;2;3;4;2;3;4;2;3;4;5};
for j=1:15,
bar3(X{j},Y{j});view(-90,0);
hold on
end

 채택된 답변

ChristianW
ChristianW 2013년 2월 7일

0 개 추천

Try hold on befor the loop:
X={1;2;3;4;5;6;7;8;9;10;11;12;13;14;15};
Y={2;3;2;3;4;2;3;4;2;3;4;2;3;4;5};
hold on
for j=1:15
bar3(X{j},Y{j});view(90,0);
end

추가 답변 (1개)

Wayne King
Wayne King 2013년 2월 7일
편집: Wayne King 2013년 2월 7일

0 개 추천

Not sure what you're trying to do and why you are using bar3()
Y={2;3;2;3;4;2;3;4;2;3;4;2;3;4;5};
Y = cell2mat(Y);
bar_h = bar(Y);
bar_child = get(bar_h,'Children');
set(bar_child,'CData',Y); colormap(jet);
The above code maps colors to the height of the bars. With the colormap set to jet, you get blue for the minimum value and red for the maximum. You are always free to design your own colormap.

카테고리

도움말 센터File Exchange에서 Color and Styling에 대해 자세히 알아보기

질문:

2013년 2월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by