I'm working on a GUI in matlab and I ended up with a really strange behaviour in my code. I manage to isolate the problem in a single script, which is the following:
fig = figure('Name','Spatial modes', ...
'numbertitle', 'off', ...
'ToolBar', 'none', ...
'outerposition',[0 0 1 1]);
for i = 1:100
hand.im_caxis.val = caxis;
axis ij equal tight
If you try to run it, you will see that the axes of the figure shift to the right every time the image is updated. After a dozen of shifts, they start shrinking until they are invisible and eventually they go back to the original size.
What is going on? What am I missing?