diff scripts/plot/xlabel.m @ 13800:5acb5c25e4ae

allow axes handle to be passed to title function * __axis_label__.m: Accept axes handle argument. Don't call gca. * xlabel.m, ylabel.m, zlabel.m: Pass axes handle to __axis_label__ instead of calling axes to temporaritly set currentaxes. Eliminate unneeded unwind_protect block. * title.m: Accept axes handle. Pass axes handle to __axis_label__.
author John W. Eaton <jwe@octave.org>
date Thu, 03 Nov 2011 04:41:40 -0400
parents e81ddf9cacd5
children 5f0bb45e615c
line wrap: on
line diff
--- a/scripts/plot/xlabel.m
+++ b/scripts/plot/xlabel.m
@@ -39,14 +39,8 @@
     print_usage ();
   endif
 
-  oldh = gca ();
-  unwind_protect
-    axes (h);
-    tmp = __axis_label__ ("xlabel", varargin{:},
-                          "color", get (h, "xcolor"));
-  unwind_protect_cleanup
-    axes (oldh);
-  end_unwind_protect
+  tmp = __axis_label__ (h, "xlabel", varargin{:},
+                        "color", get (h, "xcolor"));
 
   if (nargout > 0)
     retval = tmp;