Mercurial > hg > octave-lyh
comparison scripts/plot/private/__clabel__.m @ 11587:c792872f8942
all script files: untabify and strip trailing whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:35:29 -0500 |
parents | fd0a3ac60b0e |
children | b0084095098e |
comparison
equal
deleted
inserted
replaced
11586:12df7854fa7c | 11587:c792872f8942 |
---|---|
39 else | 39 else |
40 i1 = 1; | 40 i1 = 1; |
41 while (i1 < length (c)) | 41 while (i1 < length (c)) |
42 clev = c(1,i1); | 42 clev = c(1,i1); |
43 clen = c(2,i1); | 43 clen = c(2,i1); |
44 p = c(:, i1+1:i1+clen) | 44 p = c(:, i1+1:i1+clen) |
45 | 45 |
46 xmin = min (c(1,:)); | 46 xmin = min (c(1,:)); |
47 xmax = max (c(1,:)); | 47 xmax = max (c(1,:)); |
48 ymin = min (c(2,:)); | 48 ymin = min (c(2,:)); |
49 ymax = max (c(2,:)); | 49 ymax = max (c(2,:)); |
81 | 81 |
82 j1 = 2; | 82 j1 = 2; |
83 tlabel = sprintf ("%g", clev); | 83 tlabel = sprintf ("%g", clev); |
84 for i = 1 : ntag | 84 for i = 1 : ntag |
85 tagpos = pos(i); | 85 tagpos = pos(i); |
86 | 86 |
87 while (j1 < clen && cumd(j1) < tagpos) | 87 while (j1 < clen && cumd(j1) < tagpos) |
88 j1++; | 88 j1++; |
89 endwhile | 89 endwhile |
90 tpos = sum(c(:,i1+j1-1:i1+j1), 2) ./ 2; | 90 tpos = sum(c(:,i1+j1-1:i1+j1), 2) ./ 2; |
91 | 91 |
93 && tpos(2) != ymin && tpos(2) != ymax) | 93 && tpos(2) != ymin && tpos(2) != ymax) |
94 trot = 180 / pi * atan2 (diff (c(2,i1+j1-1:i1+j1)), | 94 trot = 180 / pi * atan2 (diff (c(2,i1+j1-1:i1+j1)), |
95 diff (c(1,i1+j1-1:i1+j1))); | 95 diff (c(1,i1+j1-1:i1+j1))); |
96 | 96 |
97 if (ischar (z)) | 97 if (ischar (z)) |
98 ht = text (tpos(1), tpos(2), clev, tlabel, "rotation", trot, | 98 ht = text (tpos(1), tpos(2), clev, tlabel, "rotation", trot, |
99 "parent", hparent, "horizontalalignment", "center", | 99 "parent", hparent, "horizontalalignment", "center", |
100 "userdata", clev, varargin{:}); | 100 "userdata", clev, varargin{:}); |
101 elseif (!isempty (z)) | 101 elseif (!isempty (z)) |
102 ht = text (tpos(1), tpos(2), z, tlabel, "rotation", trot, | 102 ht = text (tpos(1), tpos(2), z, tlabel, "rotation", trot, |
103 "parent", hparent, "horizontalalignment", "center", | 103 "parent", hparent, "horizontalalignment", "center", |
104 "userdata", clev, varargin{:}); | 104 "userdata", clev, varargin{:}); |
105 else | 105 else |
106 ht = text (tpos(1), tpos(2), tlabel, "rotation", trot, | 106 ht = text (tpos(1), tpos(2), tlabel, "rotation", trot, |
107 "parent", hparent, "horizontalalignment", "center", | 107 "parent", hparent, "horizontalalignment", "center", |
110 h = [h; ht]; | 110 h = [h; ht]; |
111 endif | 111 endif |
112 endfor | 112 endfor |
113 i1 += clen+1; | 113 i1 += clen+1; |
114 endwhile | 114 endwhile |
115 endfunction | 115 endfunction |