changeset 27715:95cc1f535ba8

legend.m: handle plotyy with ones axes already legend aware (bug #57257) * legend.m: handle the __legend_handle__ property one axes ata time.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Tue, 19 Nov 2019 13:23:32 +0100
parents a984e6722601
children 790038c12003
files scripts/plot/appearance/legend.m
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/legend.m	Tue Nov 19 11:16:22 2019 +0100
+++ b/scripts/plot/appearance/legend.m	Tue Nov 19 13:23:32 2019 +0100
@@ -192,11 +192,13 @@
 
     ## FIXME: Use the axes appdata to store its peer legend handle
     ## rather that adding a public property and change all uses.
-    try
-      addproperty ("__legend_handle__", opts.axes_handles, "handle", hl);
-    catch
-      set (opts.axes_handles, "__legend_handle__", hl);
-    end_try_catch
+    for htmp = opts.axes_handles
+      try
+        addproperty ("__legend_handle__", htmp, "handle", hl);
+      catch
+        set (htmp, "__legend_handle__", hl);
+      end_try_catch
+    endfor
 
     ## Add and update legend specific properties
     addproperties (hl);