diff scripts/plot/axes.m @ 6405:b298a4c12fc3

[project @ 2007-03-14 16:51:28 by jwe]
author jwe
date Wed, 14 Mar 2007 16:51:30 +0000
parents 44c91c5dfe1d
children b26a8e0e42cd
line wrap: on
line diff
--- a/scripts/plot/axes.m
+++ b/scripts/plot/axes.m
@@ -32,18 +32,16 @@
     ## make default axes object, and make it the current axes for the
     ## current figure.
     cf = gcf ();
-    tmp = __uiobject_axes_ctor__ (cf, varargin{:});
-    __uiobject_adopt__ (cf, tmp);
+    tmp = __go_axes__ (cf, varargin{:});
     set (cf, "currentaxes", tmp);
   elseif (nargin == 1)
     ## arg is axes handle, make it the current axes for the current
     ## figure.
     tmp = varargin{1};
-    obj = get (tmp);
-    if (! isempty (obj) && strcmp (obj.type, "axes"))
-      cf = gcf ();
-      __uiobject_adopt__ (cf, tmp);
-      set (cf, "currentaxes", tmp);
+    if (ishandle (tmp) && strcmp (get (tmp, "type"), "axes"))
+      parent = get (tmp, "parent");
+      set (0, "currentfigure", parent);
+      set (parent, "currentaxes", tmp);
     else
       error ("axes: expecting argument to be axes handle");
     endif