# HG changeset patch # User Markus Mützel # Date 1653586235 -7200 # Node ID 0938366560cf20f2c6f43da3d2a718cae4a5915e # Parent 9504d582b2c626d3a6d8b17bf5e37140e701e8c3 subplot.m: Avoid error when mixing rcn and "position" calling form (bug #62526). * scripts/plot/util/subplot.m: When called without "rows", "cols", and "index" arguments, don't check if existing axes have matching "__subplotrcn__" value. diff -r 9504d582b2c6 -r 0938366560cf scripts/plot/util/subplot.m --- a/scripts/plot/util/subplot.m Thu May 26 18:25:51 2022 +0200 +++ b/scripts/plot/util/subplot.m Thu May 26 19:30:35 2022 +0200 @@ -288,7 +288,7 @@ ## appdata "__subplotposition__", use the existing axes. found = true; hsubplot = child; - else + elseif (exist ("rows", "var")) ## Check if this axes is a subplot with the same layout and ## index as the requested one rcn = getappdata (child, "__subplotrcn__"); @@ -648,6 +648,18 @@ %! delete (hf); %! end_unwind_protect +## Mixed rcn and position mode +%!test <*62526> +%! hf = figure ("visible", "off"); +%! unwind_protect +%! h1 = subplot (2, 2, 1); +%! h2 = subplot ("position", [0.5 0.5 0.3 0.3]); +%! h3 = subplot (223); +%! assert (get (hf, "children"), [h3; h2; h1]); +%! unwind_protect_cleanup +%! delete (hf); +%! end_unwind_protect + ## Align mode %!test %! hf = figure ("visible", "off");