# HG changeset patch # User Rik # Date 1437669959 25200 # Node ID 56301a6c337a16a25928d35a3c4f51467cecd6ee # Parent 8c4317b8f7c55939d5545170a982912856a00a97 polar.m: Display plot titles on polar plots (bug #45514). * polar.m (__update_layer__): When re-ordering children to account for layer attribute, turn on root property "showhiddenhandles" so that hidden axis children like the title object are included in the sorting. diff --git a/scripts/plot/draw/polar.m b/scripts/plot/draw/polar.m --- a/scripts/plot/draw/polar.m +++ b/scripts/plot/draw/polar.m @@ -266,7 +266,7 @@ endfunction -function __update_lines__ (hax, ~, hg, prop) +function __update_lines__ (hax, ~, hg, prop) kids = get (hg, "children"); idx = strcmp (get (kids, "type"), "line"); @@ -286,17 +286,22 @@ endfunction -function __update_layer__ (hax, ~, hg) +function __update_layer__ (hax, ~, hg) - set (hg, "handlevisibility", "on"); - kids = get (hax, "children"); - if (strcmp (get (hax, "layer"), "bottom")) - set (hax, "children", [kids(kids != hg); hg]); - else - set (hax, "children", [hg; kids(kids != hg)]); - endif - set (hg, "handlevisibility", "off"); - + ## FIXME: This re-implements allchild() because setting the "children" + ## property needs to preserve all children (titles, xlabels, etc.). + shh = get (0, "showhiddenhandles"); + unwind_protect + set (0, "showhiddenhandles", "on"); + kids = get (hax, "children"); + if (strcmp (get (hax, "layer"), "bottom")) + set (hax, "children", [kids(kids != hg); hg]); + else + set (hax, "children", [hg; kids(kids != hg)]); + endif + unwind_protect_cleanup + set (0, "showhiddenhandles", shh); + end_unwind_protect endfunction function __update_polar_grid__ (hax, ~, hg)