diff scripts/plot/util/__plt_get_axis_arg__.m @ 17720:1ab8e21d9cfc

Further corrections to parenting of axes (bug #39813) * scripts/plot/util/newplot.m: Accept multiple graphic handles to save. Also save handles when axis nextplot property is "replacechildren". Correct failing %!test. * scripts/plot/util/__plt_get_axis_arg__.m: Return axis as first value, "parent" handle as second value. * scripts/plot/draw/surface.m: Get axis from __plt_get_axis_arg__ and ignore any other returned handles.
author Rik <rik@octave.org>
date Mon, 21 Oct 2013 22:25:15 -0700
parents ed9a21a90221
children d63878346099
line wrap: on
line diff
--- a/scripts/plot/util/__plt_get_axis_arg__.m
+++ b/scripts/plot/util/__plt_get_axis_arg__.m
@@ -28,7 +28,6 @@
   h = [];
   parent = find (strcmpi (varargin, "parent"), 1);
   
-
   ## Look for a scalar which is a graphics handle but not the
   ## Root Figure (0) or an ordinary figure (integer).
   if (numel (varargin) > 0 && numel (varargin{1}) == 1
@@ -50,7 +49,7 @@
         varargin(parent:parent+1) = [];
       else
         ## 'parent' property for some other type like hggroup
-        h = htmp;
+        h = [ancestor(htmp, "axes"), htmp];
       endif
     else
       error ("%s: expecting parent value to be axes handle", caller);