Borrar filtros
Borrar filtros

x-labels do not show in bar3 graph

2 visualizaciones (últimos 30 días)
Timur
Timur el 6 de Feb. de 2013
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

Respuesta aceptada

ChristianW
ChristianW el 7 de Feb. de 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

Más respuestas (1)

Wayne King
Wayne King el 7 de Feb. de 2013
Editada: Wayne King el 7 de Feb. de 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.

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by