x-labels do not show in bar3 graph
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150894/image.png)
0 Kommentare
Akzeptierte Antwort
ChristianW
am 7 Feb. 2013
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
0 Kommentare
Weitere Antworten (1)
Wayne King
am 7 Feb. 2013
Bearbeitet: Wayne King
am 7 Feb. 2013
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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Colormaps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!