changeset 13802:630d3c80b541

allow axes handle to be passed to patch function * patch.m: Accept axes handle argument. Don't call gca. Eliminate unneeded unwind_protect block.
author John W. Eaton <jwe@octave.org>
date Thu, 03 Nov 2011 05:07:51 -0400
parents 195ff3561152
children a2e158c3451f
files scripts/plot/patch.m
diffstat 1 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/patch.m	Thu Nov 03 05:01:52 2011 -0400
+++ b/scripts/plot/patch.m	Thu Nov 03 05:07:51 2011 -0400
@@ -43,17 +43,11 @@
 
   [h, varargin] = __plt_get_axis_arg__ ("patch", varargin{:});
 
-  oldh = gca ();
+  [tmp, failed] = __patch__ (h, varargin{:});
 
-  unwind_protect
-    axes (h);
-    [tmp, failed] = __patch__ (h, varargin{:});
-    if (failed)
-      print_usage ();
-    endif
-  unwind_protect_cleanup
-    axes (oldh);
-  end_unwind_protect
+  if (failed)
+    print_usage ();
+  endif
 
   if (nargout > 0)
     retval = tmp;