colormap problem. bar graph doesn`t respond to colormap command
Mostrar comentarios más antiguos
I use matlab 2018b version.
colormap option still works with bar3 graphs, but doesn`t work with bar graphs.
bar3(rand(5),'stacked')
colormap(cool)

bar(rand(5),'stacked')
colormap(cool)

is there an alternative way to set the colormap for bar graph?
3 comentarios
Clay Fulcher
el 27 de Mzo. de 2020
I sure hope there's an answer to this. I can't change the colormap in a bar chart anymore. Very frustrating.
Clay Fulcher
el 29 de Mzo. de 2020
I finally figured out how to get the colormap to respond. When you change the colormap, you now have to take an extra step to assign the sets of bars to rows in the colormap. Here is an example for a bar plot with 2 groups.
>> y=randn(6,2);
>> b=bar(y,'facecolor','flat');
>> for k=1:size(y,2)
b(k).CData=k;
end
>> colormap copper
Clunky, but it works. Mathworks made something complicated that used to be simple.

Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Color and Styling en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!