changeset 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 3a10d5bdada8
children fd6e50e2eee6
files scripts/plot/legend.m
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/legend.m	Wed Apr 25 14:12:12 2012 -0600
+++ b/scripts/plot/legend.m	Tue May 01 19:38:51 2012 -0400
@@ -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;