This is an intended change in the behavior of the LEGEND in MATLAB 7.1.0 (R14SP3) incorporated to allow LEGEND to follow the plot box. However, you can explicitly set the 'Location' property of the LEGEND in order not to relocate from its original position as follows:
sphere;
h = legend('sphere');
set(h,'Location','none');
You can also interactively set the 'Location' property of the LEGEND to 'NONE' using the property inspector. Perform the following steps:
1. From the 'View' menu of the figure toolbar, select 'Property Editor '
2. Highlight the LEGEND and select 'Inspector' from its 'Property Editor'
3. Set the 'Location' property to 'none'
Best Answer