diff scripts/plot/private/__axis_label__.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 22bc9ec80c2c
children 72c96de7a403
line wrap: on
line diff
--- a/scripts/plot/private/__axis_label__.m
+++ b/scripts/plot/private/__axis_label__.m
@@ -17,23 +17,21 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} __axis_label__ (@var{caller}, @var{txt}, @dots{})
+## @deftypefn {Function File} {} __axis_label__ (@var{caller}, @var{h}, @var{txt}, @dots{})
 ## Undocumented internal function.
 ## @end deftypefn
 
 ## Author: jwe
 
-function retval = __axis_label__ (caller, txt, varargin)
+function retval = __axis_label__ (ah, caller, txt, varargin)
 
-  ca = gca ();
-
-  h = get (gca (), caller);
+  h = get (ah, caller);
 
-  set (h, "fontangle", get (ca, "fontangle"),
-       "fontname", get (ca, "fontname"),
-       "fontsize", get (ca, "fontsize"),
-       "fontunits", get (ca, "fontunits"),
-       "fontweight", get (ca, "fontweight"),
+  set (h, "fontangle", get (ah, "fontangle"),
+       "fontname", get (ah, "fontname"),
+       "fontsize", get (ah, "fontsize"),
+       "fontunits", get (ah, "fontunits"),
+       "fontweight", get (ah, "fontweight"),
        "string", txt,
        varargin{:});