# HG changeset patch # User Rik # Date 1646617882 28800 # Node ID 620607ec660892d1fa4047fdd5a1d944f37aaf66 # Parent f5587d651bc7b45f5ba293a4c3cf5ba933cd60e6 Fix saving and loading of polar plots (bug #62093) * hdl2struct.m: When converting an axes handle, check whether there is a hidden hggroup wit the "polar_grid" tag. If there is, add it to the list of handles to be converted. * struct2hdl.m (createhg): When creating an hggroup, check if the tag property is "polar_grid" and if so then change "handlevisibility" property to "off". diff -r f5587d651bc7 -r 620607ec6608 scripts/plot/util/hdl2struct.m --- a/scripts/plot/util/hdl2struct.m Sat Mar 05 11:27:03 2022 +0100 +++ b/scripts/plot/util/hdl2struct.m Sun Mar 06 17:51:22 2022 -0800 @@ -58,13 +58,19 @@ hnot = findobj (h, "-depth", 1, "tag", "legend", "-or", "tag", "colorbar", "-or", "type", "uimenu"); kids = allkids(! ismember (allkids, hnot)); + if (strcmp (s.type, "axes")) + ## Check for polar plots with special "polar_grid" object + ## FIXME: A hack to fix bug #62093. + kids = [kids; findall(h, "tag", "polar_grid")]; + endif + nkids = length (kids); for i = nkids:-1:1 s.children(++ii) = hdl2struct (kids(i)); endfor endif - ## add non "children" children objects (title, xlabel, ...) and + ## Add non "children" children objects (title, xlabel, ...) and ## hggroup children and tag them in "special" if (strcmp (s.type, "hggroup")) special = allkids; diff -r f5587d651bc7 -r 620607ec6608 scripts/plot/util/struct2hdl.m --- a/scripts/plot/util/struct2hdl.m Sat Mar 05 11:27:03 2022 +0100 +++ b/scripts/plot/util/struct2hdl.m Sun Mar 06 17:51:22 2022 -0800 @@ -441,9 +441,9 @@ function [h, sout, pout] = createhg (s, p, par, hilev) ## Here we infer from properties the type of hggroup we should build - ## an call corresponding high level functions + ## and call the corresponding high level functions. ## We manually set "hold on" to avoid next hggroup be deleted - ## the proper value of axes "nextplot" will finally be recovered + ## the proper value of axes "nextplot" will finally be recovered. hold on; if (hilev) @@ -475,6 +475,12 @@ s.special = []; endif + ## Check for polar plots with special "polar_grid" object + ## FIXME: A hack to fix bug #62093. + if (strcmp (s.properties.tag, "polar_grid")) + s.properties.handlevisibility = "off"; + endif + sout = s; pout = p;