changeset 17027:75d115e329b7

__plt_get_axis_arg__.m: Correctly handle 'parent' property when parent is hggroup. * scripts/plot/__plt_get_axis_arg__.m: Don't delete 'parent'/value pair if it represents an hggroup. Downstream plot function will use this property.
author Rik <rik@octave.org>
date Sat, 20 Jul 2013 18:42:25 -0700
parents c358c6e7416b
children be52288f827b
files scripts/plot/__plt_get_axis_arg__.m
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/__plt_get_axis_arg__.m
+++ b/scripts/plot/__plt_get_axis_arg__.m
@@ -45,9 +45,8 @@
       && varargin{1} != 0 && ! isfigure (varargin{1}))
     htmp = varargin{1};
     obj = get (htmp);
-    if ((strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
-        || strcmp (obj.type, "hggroup"))
-      h = ancestor (htmp, "axes");
+    if (strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
+      h = htmp;
       varargin(1) = [];
     else
       error ("%s: expecting first argument to be axes handle", caller);
@@ -56,12 +55,12 @@
     if (parent < numel (varargin) && ishandle (varargin{parent+1}))
       htmp = varargin{parent+1};
       obj = get (htmp);
-      if ((strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
-          || strcmp (obj.type, "hggroup"))
-        h = ancestor (htmp, "axes");
+      if (strcmp (obj.type, "axes") && ! strcmp (obj.tag, "legend"))
+        h = htmp;
         varargin(parent:parent+1) = [];
       else
-        error ("%s: expecting parent value to be axes handle", caller);
+        ## 'parent' property for some other type like hggroup
+        h = ancestor (htmp, "axes");
       endif
     else
       error ("%s: expecting parent value to be axes handle", caller);