MATLAB: Is MOVEGUI unable to place figures at the correct locations in MATLAB 7.0 (R14)

marginmoveguiposition;

When I use the MOVEGUI function to specify a position for a figure, the position of the figure appears to be off the specified position, by approximately 20 pixels. For example, if I use:
fig = figure;
movegui(fig,'north')
then there is a gap between the figure and the top of my screen.

Best Answer

This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
We have verified that there is a bug in MATLAB 7.0 (R14) in the way that MOVEGUI calculates the position for figures.
To workaround this issue, you can modify MOVEGUI, so that there is no margin being used. To do this, change line 167 of $MATLAB\toolbox\matlab\uitools\movegui.m (where $MATLAB is the root MATLAB directory as returned by the MATLABROOT function) from:
margin = 20;
to
margin = 0;