Mercurial > hg > octave-nkf
diff scripts/plot/legend.m @ 14585:c38a253723d3
Syncrhonize legend's "visible" and "box" properties. (Bug # 36136)
legend.m: For "legend show", set the legend's "visible" property value equal
to its "box" property value. Modify demo.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Tue, 01 May 2012 19:38:51 -0400 |
parents | 7d11812c52aa |
children | fd6e50e2eee6 |
line wrap: on
line diff
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -285,6 +285,8 @@ elseif (strcmp (show, "on")) if (! isempty (hlegend)) set (findobj (hlegend), "visible", "on"); + ## NOTE - Matlab sets both "visible", and "box" to "on" + set (hlegend, "visible", get (hlegend, "box")); else hobjects = []; hplots = []; @@ -978,6 +980,9 @@ %! clf; %! x = 0:1; %! plot (x,x,';I am Blue;', x,2*x,';I am Green;', x,3*x,';I am Red;'); +%! legend boxon +%! legend hide +%! legend show %!demo %! clf;