This enhancement has been incorporated in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
The documentation on the 'boxon' and 'boxoff' options for the LEGEND function in MATLAB may be somewhat unclear. Here is a more complete description of these options:
legend('boxoff'), legend(axes_handle,'boxoff') removes the box from the legend in the current axes or the axes specified by axes_handle and makes the legend background transparent.
legend('boxon'), legend(axes_handle,'boxon') adds a box with an opaque background to the legend in the current axes or the axes specified by axes_handle.
Best Answer