changeset 17043:1b549a0c3ca4

text.m: Update to use new __plt_get_axis_arg__. * scripts/plot/text.m: Update to use new __plt_get_axis_arg__.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 22 Jul 2013 22:58:04 +0200
parents 55b76fd1244b
children 62d5f73e840c
files scripts/plot/text.m
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/text.m
+++ b/scripts/plot/text.m
@@ -118,17 +118,23 @@
     print_usage ();
   endif
 
+  ## Get axis argument which may be in a 'parent' PROP/VAL pair
+  [hax, varargin] = __plt_get_axis_arg__ ("text", varargin{:});
+
+  if (isempty (hax))
+    hax = gca ();
+  endif
+
   if (nx == ny && nx == nz && (nt == nx || nt == 1 || nx == 1))
     pos = [x(:), y(:), z(:)];
-    ca = gca ();
     htmp = zeros (nt, 1);
     if (nx == 1)
-      htmp = __go_text__ (ca, "string", label{1},
+      htmp = __go_text__ (hax, "string", label{1},
                           varargin{:},
                           "position", pos);
     elseif (nx == nt)
       for n = 1:nt
-        htmp(n) = __go_text__ (ca, "string", label{n},
+        htmp(n) = __go_text__ (hax, "string", label{n},
                                varargin{:},
                                "position", pos(n,:));
       endfor