# HG changeset patch # User Rik # Date 1397016786 25200 # Node ID 8c0646dd9e5a0cf19b2fee0c2ca4224a8b730b29 # Parent ac75140f2c97c47ebe219e73ebd66fc1642d35e2 legend.m: Fix bug updating plotyy figures (bug #41970). * legend.m (updatelegend): Restore "units" property to potentially multiple axes. When re-invoking legend, use just the first handle of any handle list. * __getlegenddata__.m: Fix cut and paste error where get called with wrong set of axes. diff -r ac75140f2c97 -r 8c0646dd9e5a scripts/plot/appearance/__getlegenddata__.m --- a/scripts/plot/appearance/__getlegenddata__.m Tue Apr 08 20:13:38 2014 -0700 +++ b/scripts/plot/appearance/__getlegenddata__.m Tue Apr 08 21:13:06 2014 -0700 @@ -29,7 +29,7 @@ if (numel (ca) == 1) kids = get (ca, "children"); else - kids = [get(kids, "children"){:}]; + kids = [get(ca, "children"){:}]; endif for i = numel (kids):-1:1 diff -r ac75140f2c97 -r 8c0646dd9e5a scripts/plot/appearance/legend.m --- a/scripts/plot/appearance/legend.m Tue Apr 08 20:13:38 2014 -0700 +++ b/scripts/plot/appearance/legend.m Tue Apr 08 21:13:06 2014 -0700 @@ -1079,8 +1079,10 @@ set (hax, "position", position); set (hax, "outerposition", outerposition); endswitch - set (hax, "units", units); - h = legend (hax, hplots, get (h, "string")); + ## Crazy syntax because set() only seems to support row vectors + set (hax, repmat ({"units"}, [1 numel(hax)]), units(:)'); + + h = legend (hax(1), hplots, get (h, "string")); unwind_protect_cleanup recursive = false; end_unwind_protect