필터 지우기
필터 지우기

x-labels do not show in bar3 graph

조회 수: 2 (최근 30일)
Timur
Timur 2013년 2월 6일
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일
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일
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.

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by