How to assign different colormaps to different stacked bars
2 views (last 30 days)
Show older comments
Commented: Tasi on 18 Nov 2017
I have a defined variable of 2x12, and would like to create a stacked bar plot but using two different colormaps defined below:
c1=[0 0 1];%B
c2=[1 1 1];%W
c3=[1 0 0]; %R
I don't know how to apply these two different colormaps on the two stacked bar plots without one overwriting the other, so I always end up with the same colormap for both stacks. Any suggestions?
Walter Roberson on 18 Nov 2017
Look in the File Exchange for freezeColors().
Draw the first item and apply its colormap. Use freezeColors() to convert it to RGB from pseudocolor. Now you can draw the second item and apply its colormap because the first item is no longer using colormaps.
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!