Question About bar plot

1 view (last 30 days)
Raldi
Raldi on 27 Jan 2012
hello everyone, I wanted to ask if it is possible in a bar plot of lets say 200 items to make one bar red and keep all the others at their default colors?
  1 Comment
Andrew Newell
Andrew Newell on 27 Jan 2012
Do you want 200 bars?

Sign in to comment.

Accepted Answer

Andrew Newell
Andrew Newell on 27 Jan 2012
Yes, by splitting your bar plot into two. Here is a simple example:
% First bar plot
xdata = 1:9;
ydata = rand(9,1);
bar(xdata,ydata); hold on
% Second bar plot
xdata = 10;
ydata = rand(1);
bar(xdata,ydata,'FaceColor','r','EdgeColor','r')
  1 Comment
Raldi
Raldi on 27 Jan 2012
Thanks Andrew

Sign in to comment.

More Answers (0)

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!