I\'m using the below code to save a figure:
fig1=figure(\'visible\',\'off\'); b = bar(bar_res); x={\'a\' ;\'b\' ;\'c\'; \'d\' ;\'e\'; \'f\' ;\'g\'; \'h\';...
A simple solution may be if you call axis tight. However it may not be the result you want because it does remove the small spaces at the borders of the plot.
axis tight