# HG changeset patch # User Ben Abbott # Date 1372668355 -28800 # Node ID fb80e1891cf9a7252b3fe698a23830c3c7515873 # Parent 24574e15ac4b1260852eb35dbaedd1821467ad96 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(). diff --git a/scripts/plot/legend.m b/scripts/plot/legend.m --- 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;