Define bar plot colors with CData for different data series
20 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have data for three different measurements and I'd like to plot them in a bar graph. This works with the bar command:
s2 = [ na2 , nb2 , nc2 ];
figure;
b1 = bar(pulse2,s2,'hist','FaceColor','flat');
ni2 are vectors with the data points. Now I'd like to define the color for each series with RGB Triplets.
I know that I can access this property with b1.CData, because the FaceColor is set to flat, but I do not know how. How should the line
b1.CData(:,:) = ([0.1600 0.4400 1] [0.9300 0 0] [0.00 0.57 0.00])
Actually look like to have all the bars for series one in the color [0.1600 0.4400 1], all the bars for series two with color [0.9300 0 0] and all the bars for series three with [0.00 0.57 0.00]?
Thank you very much in advance!
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!