changeset 28785:02c2d6500c1f

maint: merge stable to default
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Wed, 23 Sep 2020 20:41:57 +0200
parents 5cfc3e1b7ff4 (current diff) 9d7f90354b4f (diff)
children 92beaab911c2
files scripts/plot/util/subplot.m
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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