If I create a colorbar and then reposition it as in the following example, the colorbar will return to its original postion when I print or resize the figure.
surf(peaks)hcb = colorbar;set(hcb,'units','centimeter','position',[8 1 2 3])
colorbarMATLABposition;printrepositionresizeunits
surf(peaks)hcb = colorbar;set(hcb,'units','centimeter','position',[8 1 2 3])
Best Answer