Mercurial > octave-nkf
comparison scripts/plot/private/__clabel__.m @ 10549:95c3e38098bf
Untabify .m scripts
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Fri, 23 Apr 2010 11:28:50 -0700 |
parents | 1aeb39118764 |
children | fe3c3dfc07eb |
comparison
equal
deleted
inserted
replaced
10548:479536c5bb10 | 10549:95c3e38098bf |
---|---|
27 lims = axis (); | 27 lims = axis (); |
28 xspacing = 72 * 4 / abs(lims(1) - lims(2)); | 28 xspacing = 72 * 4 / abs(lims(1) - lims(2)); |
29 yspacing = 72 * 3 / abs(lims(3) - lims(4)); | 29 yspacing = 72 * 3 / abs(lims(3) - lims(4)); |
30 | 30 |
31 if (isscalar (hparent) && ishandle(hparent) && | 31 if (isscalar (hparent) && ishandle(hparent) && |
32 strcmp (get (hparent, "type"), "hggroup")) | 32 strcmp (get (hparent, "type"), "hggroup")) |
33 x = get (hparent, "xdata"); | 33 x = get (hparent, "xdata"); |
34 xmin = min (x(:)); | 34 xmin = min (x(:)); |
35 xmax = max (x(:)); | 35 xmax = max (x(:)); |
36 y = get (hparent, "ydata"); | 36 y = get (hparent, "ydata"); |
37 ymin = min (y(:)); | 37 ymin = min (y(:)); |
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 |
92 if (tpos(1) != xmin && tpos(1) != xmax && | 92 if (tpos(1) != xmin && tpos(1) != xmax && |
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", |
108 "userdata", clev, varargin{:}); | 108 "userdata", clev, varargin{:}); |
109 endif | 109 endif |
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 |