File Exchange

image thumbnail


version 1.0 (1.65 KB) by

ibar() does the same as bar(), but returns an individual handle for each bar.



No License

ibar() does the same as bar(), but returns a seperate handle for each bar, therefore enabling you to address each bar and set ist properties individually, e.g. change color of single bars. To access the handles s.a. Matlab Help 'Obtaining Data from Cell Arrays'.

Comments and Ratings (4)

Shilpa Gandhi

Exactly what I needed! Thanks!

Matthias Moosmann

It was exactly what I was looking for. But unfortunately it doesn't work with R2006a...

Tim Hallett

for later version need to change the "bar command" to bar('v6',...) so get the appropriate handle assignments.

Bob Farrell

Perfect! Just want I was looking for. However, an example would have been helpful. Here is one:
y = rand(10, 1);
h = ibar(y);
% set elements 3, 5, 7 of bar plot to yellow:
set( h([3 5 7]), 'facecolor', 'yellow')


Now works for MATLAB 7, too.(MATLAB bar function changed in Version 7)

MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video