hf = figure ();

hax1 = axes;
plot (hax1, 1:10, 'o-b');
hl1 = legend ("axes1 legend");

hax2 = axes ("parent", hf, "position", [0.2, 0.6, 0.3, 0.3]);
plot (hax2, 10:-1:1, 'x-r');
hl2 = legend ("axes2 legend");

## Desired behavior, be able to control legend without switching axes,
## or having to know that legend objects are implemented as axes objects
## and that there is therefore a property "box" that can be changed.
#legend (hl1, 'boxoff')
#legend (hl2, 'boxoff')

## One workaround, switch axes and then use commands
axes (hax1);
legend ('boxoff');
axes (hax2);
legend ('boxoff');

## Second workaround, use axes, rather than legend_handle, as first arg.
legend (hax1, 'boxon');
legend (hax2, 'boxon');

