Mercurial > hg > octave-shane
changeset 16885:fb80e1891cf9
Change to legend fontsize should trigger updatelegendtext.
Using updatelegend won't work as the modifed properties are lost when the
legend is recreated.
scripts/plot/legend.m: When the fontsize for the legend object is modified
call updatelegendtext().
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 01 Jul 2013 16:45:55 +0800 |
parents | 24574e15ac4b |
children | 6ce16c7300c7 |
files | scripts/plot/legend.m |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -945,7 +945,7 @@ if (addprops) addlistener (hlegend, "edgecolor", @updatelegendtext); addlistener (hlegend, "textcolor", @updatelegendtext); - addlistener (hlegend, "fontsize", @updatelegend); + addlistener (hlegend, "fontsize", @updatelegendtext); addlistener (hlegend, "interpreter", @updatelegendtext); addlistener (hlegend, "location", @updatelegend); addlistener (hlegend, "orientation", @updatelegend); @@ -1152,6 +1152,20 @@ endif endfunction +%!test +%! graphics_toolkit ("gnuplot"); +%! h = figure ("visible", "off", "__graphics_toolkit__", "gnuplot"); +%! unwind_protect +%! position = get (h, "position"); +%! plot (rand (3)) +%! legend () +%! filename = sprintf ("%s.eps", tmpnam ()); +%! print (filename) +%! unlink (filename); +%! assert (get (h, "position"), position) +%! unwind_protect_cleanup +%! close (h) +%! end_unwind_protect %!demo %! clf;