# HG changeset patch # User Rik # Date 1380906044 25200 # Node ID 4166048ba6cfbb9cad08b4b6e53bfd8d80d6fae7 # Parent ddecb2e231d473eac16d9fcf8fe28ed195908797 text.m: Fix text location if "Position" specified as prop/value pair. * scripts/plot/text.m: Search for "position" property in input PROP/VAL pairs and use coordinates if available. diff -r ddecb2e231d4 -r 4166048ba6cf scripts/plot/text.m --- a/scripts/plot/text.m Fri Oct 04 08:05:00 2013 -0700 +++ b/scripts/plot/text.m Fri Oct 04 10:00:44 2013 -0700 @@ -131,11 +131,20 @@ hax = gca (); endif + ## Position argument may alse be in PROP/VAL pair + idx = find (strcmpi (varargin, "position"), 1); + if (idx) + pos = varargin{idx+1}; + varargin(idx:idx+1) = []; + else + pos = [x(:), y(:), z(:)]; + endif + if (nx == ny && nx == nz && (nt == nx || nt == 1 || nx == 1)) - pos = [x(:), y(:), z(:)]; htmp = zeros (nt, 1); if (nx == 1) htmp = __go_text__ (hax, "string", string{1}, + ## varargin first, in case "Units" set for pos. varargin{:}, "position", pos); elseif (nx == nt)