diff scripts/plot/patch.m @ 7177:57d2546ad8d5

[project @ 2007-11-14 22:21:35 by jwe]
author jwe
date Wed, 14 Nov 2007 22:21:36 +0000
parents 121841c08c25
children a730e47fda4d
line wrap: on
line diff
--- a/scripts/plot/patch.m
+++ b/scripts/plot/patch.m
@@ -38,12 +38,12 @@
 
   if (isscalar (varargin{1}) && ishandle (varargin{1}))
     h = varargin {1};
-    if (! strcmp (get (h, "type"), "axes"))
-      error ("patch: expecting first argument to be an axes object");
+    if (! strcmp (get (h, "type"), "axes") && ! strcmp (get (h, "type"), "hggroup"))
+      error ("patch: expecting first argument to be an axes or hggroup object");
     endif
     oldh = gca ();
     unwind_protect
-      axes (h);
+      axes (ancestor (h, "axes"));
       [tmp, fail] = __patch__ (h, varargin{2:end});
     unwind_protect_cleanup
       axes (oldh);