The below steps apply from MATLAB R2014b or newer. For older versions, use the appropriate "set" and "get" functions for graphics.
1) Obtain a handle to the histogram when first plotting it:
histHandle = histogram(data);
If the histogram has already been plotted in 'Figure n', obtain it in the following manner:
figHandle = figure(n);
axisHandle = figHandle.Children;
histHandle = axisHandle.Children;
2) Offset the bin edges by half the bin width:
histHandle.BinEdges = histHandle.BinEdges + histHandle.BinWidth/2;
Be careful not to eliminate a half-bin with data when doing this. If required, add an extra bin edge to the beginning of the "histHandle.BinEdges" vector.