changeset 18644:8c0646dd9e5a

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.
author Rik <rik@octave.org>
date Tue, 08 Apr 2014 21:13:06 -0700
parents ac75140f2c97
children ce144b2ab46c
files scripts/plot/appearance/__getlegenddata__.m scripts/plot/appearance/legend.m
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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