comparison arrows/@vplotter/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)); set(gcf,'Name',name(s));
3 h=s.opts.plotfn(zeros(1,1),s.opts.args{:});
4 if ~isempty(s.opts.ylim), ylim(s.opts.ylim); end
5 if ~isempty(s.opts.xlim), xlim(s.opts.xlim); end
6 if isfield(s.opts,'ylabel'), ylabel(s.opts.ylabel); end
7 if isfield(s.opts,'xlabel'), xlabel(s.opts.xlabel); end
8
9 u=mkunit(s);
10 if length(h)==1
11 if autoflush(s), u.process =@proc_flush;
12 else u.process=@proc_noflush; end
13 else
14 af=autoflush(s);
15 u.process =@proc_mat;
16 end
17
18 u.sizes_out = {};
19 u.dispose = @()delete(h);
20
21 function proc_flush(x), set(h,'XData',1:length(x),'YData',x); drawnow; end
22 function proc_noflush(x), set(h,'XData',1:length(x),'YData',x); end
23 function proc_mat(x),
24 dom=1:size(x,1);
25 for i=1:length(h)
26 set(h(i),'XData',dom,'YData',x(:,i));
27 end
28 if af, drawnow; end
29 end
30 end