comparison arrows/@scatterer/construct.m @ 0:672052bd81f8

Initial partial import.
author samer
date Wed, 19 Dec 2012 22:38:28 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:672052bd81f8
1 function u=construct(s,sizes_in)
2 figure(fig(s)); cla; set(gcf,'Name',name(s));
3 h=s.opts.scatfn(zeros(sizes_in{1}),s.opts.args{:});
4 if ~isempty(s.opts.xlim), xlim(s.opts.xlim); end
5 if ~isempty(s.opts.ylim), ylim(s.opts.ylim); end
6 if ~isempty(s.opts.zlim), zlim(s.opts.zlim); end
7 if isfield(s.opts,'ylabel'), ylabel(s.opts.ylabel); end
8 if isfield(s.opts,'xlabel'), xlabel(s.opts.xlabel); end
9 if isfield(s.opts,'zlabel'), xlabel(s.opts.zlabel); end
10 if isfield(s.opts,'rotate3d'), rotate3d(s.opts.rotate3d); end
11
12
13 u=mkunit(s);
14 af=autoflush(s);
15 if sizes_in{1}(2)<=2 u.process =@proc_2d;
16 else u.process =@proc_3d;
17 end
18
19 u.sizes_out = {};
20 u.dispose = @()delete(h);
21
22 function proc_2d(x)
23 set(h,'XData',x(:,1),'YData',x(:,2));
24 if (af), drawnow; end
25 end
26 function proc_3d(x)
27 set(h,'XData',x(:,1),'YData',x(:,2),'ZData',x(:,3));
28 if (af), drawnow; end
29 end
30 end