changeset 22054:55e2979e1fd1

legend.m: Don't use 'legend' tag for any non-axes, non-legend objects. * legend.m: Use "deletelegend" tag for hidden text object used to invoke destructor on legend when axes is destroyed.
author Rik <rik@octave.org>
date Wed, 06 Jul 2016 17:15:47 -0700
parents 90eca9a9c47a
children 21f3cbd5c708
files scripts/plot/appearance/legend.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/legend.m	Thu Jun 30 18:23:34 2016 +1000
+++ b/scripts/plot/appearance/legend.m	Wed Jul 06 17:15:47 2016 -0700
@@ -917,10 +917,10 @@
 
         ## Add an invisible text object to original axis
         ## that when it is destroyed will remove the legend
-        props = {"parent", ca(1), "tag", "legend", ...
+        props = {"parent", ca(1), "tag", "deletelegend", ...
                  "handlevisibility", "off", "visible", "off", ...
                  "xliminclude", "off", "yliminclude", "off"};
-        t1 = findall (ca(1), "tag", "legend", "type", "text");
+        t1 = findall (ca(1), "tag", "deletelegend", "type", "text");
         if (isempty (t1))
           t1 = text (0, 0, "", props{:});
           set (t1, "deletefcn", {@deletelegend1, hlegend});