Mercurial > hg > octave-nkf
diff scripts/plot/draw/polar.m @ 20588:56301a6c337a stable
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.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 23 Jul 2015 09:45:59 -0700 |
parents | 4197fc428c7d |
children | 421e3ebfca8d |
line wrap: on
line diff
--- 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)