changeset 31332:472df5147221

legend.m: fix error with contour plot containing clabels (bug #63262) * legend.m (create_item): Remove text objects from the list of children to consider for shaping the legend icon.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Sun, 23 Oct 2022 23:06:35 +0200
parents 900c7d9f7fdd
children 01591d17cc77
files scripts/plot/appearance/legend.m
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/legend.m	Sun Oct 23 12:20:07 2022 +0200
+++ b/scripts/plot/appearance/legend.m	Sun Oct 23 23:06:35 2022 +0200
@@ -1042,6 +1042,8 @@
       typ = creator;
       switch (creator)
         case "__contour__"
+          ## Eliminate eventual text objects created by clabel
+          kids(strcmp (get (kids, "type"), "text")) = [];
           hplt = [kids(end), kids(1)];
         case {"__errplot__", "__quiver__", "__stem__"}
           hplt = kids(2:-1:1);