Mercurial > hg > octave-max
comparison 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 |
comparison
equal
deleted
inserted
replaced
14584:3a10d5bdada8 | 14585:c38a253723d3 |
---|---|
283 hplots = []; | 283 hplots = []; |
284 text_strings = {}; | 284 text_strings = {}; |
285 elseif (strcmp (show, "on")) | 285 elseif (strcmp (show, "on")) |
286 if (! isempty (hlegend)) | 286 if (! isempty (hlegend)) |
287 set (findobj (hlegend), "visible", "on"); | 287 set (findobj (hlegend), "visible", "on"); |
288 ## NOTE - Matlab sets both "visible", and "box" to "on" | |
289 set (hlegend, "visible", get (hlegend, "box")); | |
288 else | 290 else |
289 hobjects = []; | 291 hobjects = []; |
290 hplots = []; | 292 hplots = []; |
291 text_strings = {}; | 293 text_strings = {}; |
292 endif | 294 endif |
976 | 978 |
977 %!demo | 979 %!demo |
978 %! clf; | 980 %! clf; |
979 %! x = 0:1; | 981 %! x = 0:1; |
980 %! plot (x,x,';I am Blue;', x,2*x,';I am Green;', x,3*x,';I am Red;'); | 982 %! plot (x,x,';I am Blue;', x,2*x,';I am Green;', x,3*x,';I am Red;'); |
983 %! legend boxon | |
984 %! legend hide | |
985 %! legend show | |
981 | 986 |
982 %!demo | 987 %!demo |
983 %! clf; | 988 %! clf; |
984 %! x = 0:1; | 989 %! x = 0:1; |
985 %! plot (x, x, ';\alpha;', ... | 990 %! plot (x, x, ';\alpha;', ... |