# HG changeset patch # User Ben Abbott # Date 1335915531 14400 # Node ID c38a253723d31d6a7611ebd7616bca59017ffeed # Parent 3a10d5bdada85536de491694f07c7f7c1b90f261 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. diff --git a/scripts/plot/legend.m b/scripts/plot/legend.m --- 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;