How to change the color for bar graphs and create space between grouped bars?
Show older comments
Hi How to change the face color of the individual bar in a grouped bar chart. How to create space between different groups in a bar chart.
For example, as shown in the below image. I have 3 different category i.e. A,B,C and each category has 5 bars i.e. 2,5,10 20 and 25. How to create this kind of graph in matlab.

The data for A, B, C are... A= [10,13,9,6,20]' B= [2, 4, 7, 9,10]' C=[-2,-3,-8,-10,-11]'
Thanks
Accepted Answer
More Answers (2)
R7 DR
on 9 Jul 2017
0 votes
1 Comment
Another Matlab weakpoint -- there's no explaining TMW's failure to include multitude of hatching patterns in lo! these many years.
I've also tried a number of FEX hatching submissions and had only marginal success with any of them, sorry.
The ones I've used worked (to a lesser or greater degree of pleasing success) directly on patch object handles; I don't know about trying them with bar series objects.
In short, I don't know enough specifically to help; I'd suggest it's a big enough oversight to be worth a bug/feature report and enhancement request. I don't recall if I actually submitted one back when was playing with those routines or not; that was a couple years ago now...
Hunter Pruett
on 23 May 2020
Edited: Hunter Pruett
on 23 May 2020
0 votes
Just finished the barmod function--controls relative position of just about everything in the plot. Hope this helps anyone else with this question--I was having similar issues and found the lack of functionality a bit disappointing. See the demo for color modification and such.
Categories
Find more on Discrete Data Plots 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!