# HG changeset patch # User Pantxo Diribarne # Date 1600886517 -7200 # Node ID 02c2d6500c1f3c9882b00ac4d389ec9c91d790d9 # Parent 5cfc3e1b7ff4ac54df46994053832814c73cc516# Parent 9d7f90354b4f15b17ba2150d1e4dc85b2f0f936e maint: merge stable to default diff -r 5cfc3e1b7ff4 -r 02c2d6500c1f scripts/plot/util/subplot.m --- a/scripts/plot/util/subplot.m Wed Sep 23 08:49:31 2020 +0200 +++ b/scripts/plot/util/subplot.m Wed Sep 23 20:41:57 2020 +0200 @@ -249,15 +249,12 @@ continue; endif - if (isappdata (child, "__subplotposition__")) - objpos = getappdata (child, "__subplotposition__"); - else - objpos = get (child, "position"); - endif - if (all (abs (objpos - pos) < eps) && ! replace_axes) - ## If the new axes are in exactly the same position - ## as an existing axes object, or if they share the same - ## appdata "__subplotposition__", use the existing axes. + ## Check if this axes is a subplot with the same layout and + ## index as the requested one + rcn = getappdata (child, "__subplotrcn__"); + + if (! replace_axes && all (size (rcn) == [1 3]) + && rcn{1} == rows && rcn{2} == cols && all (rcn{3} == index)) found = true; hsubplot = child; else