changeset 16802:56102c33122d

Fix problems with changeset 286904321282. legend.m: Do not delete invisible legend text object. Fix typo.
author Ben Abbott <bpabbott@mac.com>
date Sat, 22 Jun 2013 13:38:03 +0800
parents 286904321282
children d3beeaf1d363
files scripts/plot/legend.m
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/legend.m
+++ b/scripts/plot/legend.m
@@ -511,7 +511,7 @@
     if (isempty (hplots))
       if (! isempty (hlegend))
         fkids = get (fig, "children");
-        delete_legend (fkids(fkids == hlegend));
+        delete (fkids(fkids == hlegend));
         hlegend = [];
         hobjects = [];
         hplots  = [];
@@ -869,13 +869,8 @@
         props = {"parent", ca(1), "tag", "legend", ...
                  "handlevisibility", "off", "visible", "off", ...
                  "xliminclude", "off", "yliminclude", "off"};
-        t1 = findall (ca(1), props{:}, "type", "text");
+        t1 = findall (ca(1), props{3:4}, "type", "text");
         if (isempty (t1))
-          ht = findall (ca(1), "type", "text", props{3:end});
-          if (! isempty (ht))
-            set (ht, "deletefcn", "")
-            delete (ht);
-          endif
           t1 = text (0, 0, "", props{:});
           set (t1, "deletefcn", {@deletelegend1, hlegend});
         endif