Please explain "not properly" with some details. This works fine in Matlab 2009a:
panelH = uipanel('Position', [0.2, 0.2, 0.5, 0.5]);
axesH = axes('Parent', panelH);
The function MAGINIFY is fragil: It sets the figure coordinates to pixels, overwrites the UserData of the figure and the axes, uses the CurrentAxes and fails if it has a hidden handle. Perhaps this collides with your GUI design.