comparison scripts/plot/draw/polar.m @ 20413: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
comparison
equal deleted inserted replaced
20355:8c4317b8f7c5 20413:56301a6c337a
264 idx = strcmp (get (kids, "type"), "text"); 264 idx = strcmp (get (kids, "type"), "text");
265 set (kids(idx).', prop, get (hax, prop)); 265 set (kids(idx).', prop, get (hax, prop));
266 266
267 endfunction 267 endfunction
268 268
269 function __update_lines__ (hax, ~, hg, prop) 269 function __update_lines__ (hax, ~, hg, prop)
270 270
271 kids = get (hg, "children"); 271 kids = get (hg, "children");
272 idx = strcmp (get (kids, "type"), "line"); 272 idx = strcmp (get (kids, "type"), "line");
273 lprop = prop; 273 lprop = prop;
274 if (strcmp (prop, "gridlinestyle")) 274 if (strcmp (prop, "gridlinestyle"))
284 idx = strcmp (get (kids, "type"), "patch"); 284 idx = strcmp (get (kids, "type"), "patch");
285 set (kids(idx).', "facecolor", get (hax, "color")); 285 set (kids(idx).', "facecolor", get (hax, "color"));
286 286
287 endfunction 287 endfunction
288 288
289 function __update_layer__ (hax, ~, hg) 289 function __update_layer__ (hax, ~, hg)
290 290
291 set (hg, "handlevisibility", "on"); 291 ## FIXME: This re-implements allchild() because setting the "children"
292 kids = get (hax, "children"); 292 ## property needs to preserve all children (titles, xlabels, etc.).
293 if (strcmp (get (hax, "layer"), "bottom")) 293 shh = get (0, "showhiddenhandles");
294 set (hax, "children", [kids(kids != hg); hg]); 294 unwind_protect
295 else 295 set (0, "showhiddenhandles", "on");
296 set (hax, "children", [hg; kids(kids != hg)]); 296 kids = get (hax, "children");
297 endif 297 if (strcmp (get (hax, "layer"), "bottom"))
298 set (hg, "handlevisibility", "off"); 298 set (hax, "children", [kids(kids != hg); hg]);
299 299 else
300 set (hax, "children", [hg; kids(kids != hg)]);
301 endif
302 unwind_protect_cleanup
303 set (0, "showhiddenhandles", shh);
304 end_unwind_protect
300 endfunction 305 endfunction
301 306
302 function __update_polar_grid__ (hax, ~, hg) 307 function __update_polar_grid__ (hax, ~, hg)
303 308
304 ## Delete existing polar grid 309 ## Delete existing polar grid