MATLAB Answers

0

Changing color of single bars in a bar plot

Asked by Omar Mian on 4 Jan 2012
Latest activity Answered by ifham khan on 27 Dec 2016
Hello,
The following will give a bar plot consisting of 2 groups of 3 bars:
figure(1),clf
xdata = [1 2];
ydata = [1 2 3; 4 5 6];
hb = bar(xdata,ydata,1);
The following will change the color of the frist bar in each group:
set(hb(1),'facecolor','w')
But I want to change the color of a single bar (e.g., the first bar in the first group). How do I achieve that?
Thanks

  0 Comments

Sign in to comment.

Tags

2 Answers

Answer by Dr. Seis
on 4 Jan 2012

  0 Comments

Sign in to comment.


Answer by ifham khan on 27 Dec 2016

I just want to get different color of bar for each label spend much time but got nothing. need help urgent

  0 Comments

Sign in to comment.