Use the 'BarWidth' option to give the fraction of width the bars are:
barWidth = handles.slider1.Value; % Get slider value. Must be between 0 and 1
% Now call bar() with the width passed in
bar(x, y, 'BarWidth', barWidth);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!