|
24 | 24 | % Copyright 1998 by Toby Driscoll.
|
25 | 25 | % $Id: deplot.m 226 2003-01-08 16:59:17Z driscoll $
|
26 | 26 |
|
27 |
| -n = length(w); |
28 | 27 | beta = beta(:);
|
29 | 28 | z = z(:);
|
30 | 29 |
|
|
46 | 45 | end
|
47 | 46 |
|
48 | 47 | % Integer arguments must be converted to specific values
|
49 |
| -if (length(R)==1) & (R == round(R)) |
| 48 | +if (length(R)==1) && (R == round(R)) |
50 | 49 | m = R+2;
|
51 | 50 | R = fliplr(linspace(.25,1,m));
|
52 | 51 | R([1,m]) = [];
|
53 | 52 | end
|
54 |
| -if (length(theta)==1) & (theta == round(theta)) |
| 53 | +if (length(theta)==1) && (theta == round(theta)) |
55 | 54 | m = theta+1;
|
56 | 55 | theta = linspace(0,2*pi,m);
|
57 | 56 | theta(m) = [];
|
58 | 57 | end
|
59 | 58 |
|
60 |
| -autoscale = strcmp(get(gca,'xlimmode'),'auto') & ... |
| 59 | +autoscale = strcmp(get(gca,'xlimmode'),'auto') && ... |
61 | 60 | strcmp(get(gca,'ylimmode'),'auto');
|
62 | 61 | autoscale = autoscale | ~ishold;
|
63 | 62 |
|
|
69 | 68 | ax = [findobj(fig,'tag','PhysicalAxes');...
|
70 | 69 | findobj(fig,'tag','CanonicalAxes')];
|
71 | 70 | if length(ax)==2
|
72 |
| - draw2 = logical(1); |
| 71 | + draw2 = true; |
73 | 72 | vis = get(ax,'vis');
|
74 | 73 | else
|
75 |
| - draw2 = logical(0); |
| 74 | + draw2 = false; |
76 | 75 | ax = gca;
|
77 | 76 | vis = {'on'};
|
78 | 77 | end
|
|
112 | 111 | for j = 1:length(R)
|
113 | 112 | % Start with evenly spaced theta
|
114 | 113 | tp = linspace(0,2*pi,20)';
|
115 |
| - new = logical(ones(length(tp),1)); |
116 |
| - wp = repmat(NaN,size(new)); |
| 114 | + new = true(length(tp),1); |
| 115 | + wp = NaN(size(new)); |
117 | 116 |
|
118 | 117 | % The individual points will be shown as they are found
|
119 |
| - linh(j,1) = line(NaN,NaN,'parent',ax(1),'color',color,'vis',vis{1},... |
120 |
| - 'linestyle','none','marker','.','markersize',7,'erasemode','none'); |
| 118 | + linh(j,1) = animatedline('parent',ax(1),'color',color,'vis',vis{1},... |
| 119 | + 'linestyle','none','marker','.','markersize',7); |
121 | 120 | if draw2
|
122 |
| - linh(j,2) = line(NaN,NaN,'parent',ax(2),'color',color,'vis',vis{2},... |
123 |
| - 'linestyle','none','marker','.','markersize',7,'erasemode','none'); |
| 121 | + linh(j,2) = animatedline('parent',ax(2),'color',color,'vis',vis{2},... |
| 122 | + 'linestyle','none','marker','.','markersize',7); |
124 | 123 | end
|
125 |
| - |
| 124 | + |
126 | 125 | % Adaptively refine theta to make smooth curve
|
127 | 126 | iter = 0;
|
128 |
| - while (any(new)) & (iter < maxrefn) |
| 127 | + while (any(new)) && (iter < maxrefn) |
129 | 128 | drawnow
|
130 |
| - zp = R(j)*exp(i*tp(new)); |
| 129 | + zp = R(j)*exp(1i*tp(new)); |
131 | 130 | neww = demap(zp,w,beta,z,c,qdat);
|
132 | 131 | wp(new) = neww;
|
133 | 132 | iter = iter + 1;
|
134 | 133 |
|
135 | 134 | % Update the points to show progress
|
136 |
| - set(linh(j,1),'xdata',real(wp),'ydata',imag(wp)) |
| 135 | + addpoints(linh(j,1),real(wp(new)),imag(wp(new))) |
137 | 136 | if draw2
|
138 |
| - set(linh(j,2),'xdata',R(j)*cos(tp),'ydata',R(j)*sin(tp)) |
| 137 | + addpoints(linh(j,1),R(j)*cos(tp(new)),R(j)*sin(tp(new))) |
139 | 138 | end
|
| 139 | + drawnow update |
140 | 140 |
|
141 | 141 | % Add points to zp where necessary
|
142 | 142 | [tp,wp,new] = scpadapt(tp,wp,minlen,maxlen,axis);
|
143 | 143 |
|
144 | 144 | end
|
145 | 145 | % Set the lines to be solid
|
146 |
| - set(linh(j,1),'erasemode','back') |
147 |
| - set(linh(j,1),'marker','none','linestyle','-','user',R(j)*exp(i*tp)) |
| 146 | + clearpoints(linh(j,1)) |
| 147 | + addpoints(linh(j,1),real(wp),imag(wp)); |
| 148 | + set(linh(j,1),'marker','none','linestyle','-','user',R(j)*exp(1i*tp)) |
148 | 149 | if draw2
|
149 | 150 | % Replace the points with (hopefully) a smooth circle
|
150 |
| - tp = linspace(0,2*pi,101); |
151 |
| - set(linh(j,2),'erasemode','back') |
152 |
| - set(linh(j,2),'marker','none','linestyle','-',... |
153 |
| - 'xdata',R(j)*cos(tp),'ydata',R(j)*sin(tp)) |
| 151 | + tp = linspace(0,2*pi,361); |
| 152 | + clearpoints(linh(j,2)) |
| 153 | + addpoints(linh(j,2),R(j)*cos(tp),R(j)*sin(tp)) |
| 154 | + set(linh(j,2),'marker','none','linestyle','-') |
154 | 155 | end
|
155 | 156 | drawnow
|
156 | 157 | end
|
|
161 | 162 | linh = gobjects(length(theta),2);
|
162 | 163 | for j = 1:length(theta)
|
163 | 164 | Rp = [0 linspace(.2,1,14)]';
|
164 |
| - zp = Rp*exp(i*theta(j)); |
165 |
| - new = logical(ones(length(zp),1)); |
166 |
| - wp = repmat(NaN,size(new)); |
| 165 | + zp = Rp*exp(1i*theta(j)); |
| 166 | + new = true(length(zp),1); |
| 167 | + wp = NaN(size(new)); |
167 | 168 | new(1) = 0;
|
168 | 169 | wp(1) = Inf;
|
169 | 170 |
|
170 | 171 | % The individual points will be shown as they are found
|
171 |
| - linh(j,1) = line(NaN,NaN,'parent',ax(1),'color',color,'vis',vis{1},... |
172 |
| - 'linestyle','none','marker','.','markersize',7,'erasemode','none'); |
| 172 | + linh(j,1) = animatedline('parent',ax(1),'color',color,'vis',vis{1},... |
| 173 | + 'linestyle','none','marker','.','markersize',7); |
173 | 174 | if draw2
|
174 |
| - linh(j,2) = line(NaN,NaN,'parent',ax(2),'color',color,'vis',vis{2},... |
175 |
| - 'linestyle','none','marker','.','markersize',7,'erasemode','none'); |
| 175 | + linh(j,2) = animatedline('parent',ax(2),'color',color,'vis',vis{2},... |
| 176 | + 'linestyle','none','marker','.','markersize',7); |
176 | 177 | end
|
177 | 178 |
|
178 | 179 | % Adaptively refine to make smooth curve
|
179 | 180 | iter = 0;
|
180 |
| - while (any(new)) & (iter < maxrefn) |
| 181 | + while (any(new)) && (iter < maxrefn) |
181 | 182 | drawnow
|
182 | 183 | neww = demap(zp(new),w,beta,z,c,qdat);
|
183 | 184 | wp(new) = neww;
|
184 | 185 | iter = iter + 1;
|
185 | 186 |
|
186 | 187 | % Update the points to show progress
|
187 |
| - set(linh(j,1),'xdata',real(wp),'ydata',imag(wp)) |
| 188 | + addpoints(linh(j,1),real(wp(new)),imag(wp(new))) |
188 | 189 | if draw2
|
189 |
| - set(linh(j,2),'xdata',real(zp),'ydata',imag(zp)) |
| 190 | + addpoints(linh(j,1),real(zp(new)),imag(zp(new))) |
190 | 191 | end
|
| 192 | + drawnow update |
191 | 193 |
|
192 | 194 | % Add points to zp where necessary
|
193 | 195 | [zp,wp,new] = scpadapt(zp,wp,minlen,maxlen,axis);
|
194 | 196 | end
|
195 | 197 |
|
196 | 198 | % Set the lines to be solid
|
197 |
| - set(linh(j,1),'erasemode','back') |
| 199 | + clearpoints(linh(j,1)) |
| 200 | + addpoints(linh(j,1),real(wp),imag(wp)); |
198 | 201 | set(linh(j,1),'marker','none','linestyle','-','user',zp)
|
199 | 202 | if draw2
|
200 | 203 | % Replace the points with just the ends
|
201 |
| - set(linh(j,2),'erasemode','back') |
202 |
| - set(linh(j,2),'marker','none','linestyle','-',... |
203 |
| - 'xdata',[0 1]*cos(theta(j)),'ydata',[0 1]*sin(theta(j))) |
| 204 | + clearpoints(linh(j,2)) |
| 205 | + addpoints(linh(j,2),[0 1]*cos(theta(j)),[0 1]*sin(theta(j))) |
| 206 | + set(linh(j,2),'marker','none','linestyle','-') |
204 | 207 | end
|
205 | 208 | drawnow
|
206 | 209 | end
|
|
209 | 212 | if ~draw2
|
210 | 213 | linh = linh(:,1);
|
211 | 214 | end
|
212 |
| -set(linh,'erasemode','normal') |
213 | 215 |
|
214 | 216 | refresh
|
215 | 217 |
|
|
0 commit comments