samer@0: function u=construct(s,sizes_in) samer@0: figure(fig(s)); set(gcf,'Name',name(s)); samer@0: h=s.opts.plotfn(zeros(1,1),s.opts.args{:}); samer@0: if ~isempty(s.opts.ylim), ylim(s.opts.ylim); end samer@0: if ~isempty(s.opts.xlim), xlim(s.opts.xlim); end samer@0: if isfield(s.opts,'ylabel'), ylabel(s.opts.ylabel); end samer@0: if isfield(s.opts,'xlabel'), xlabel(s.opts.xlabel); end samer@0: samer@0: u=mkunit(s); samer@0: if length(h)==1 samer@0: if autoflush(s), u.process =@proc_flush; samer@0: else u.process=@proc_noflush; end samer@0: else samer@0: af=autoflush(s); samer@0: u.process =@proc_mat; samer@0: end samer@0: samer@0: u.sizes_out = {}; samer@0: u.dispose = @()delete(h); samer@0: samer@0: function proc_flush(x), set(h,'XData',1:length(x),'YData',x); drawnow; end samer@0: function proc_noflush(x), set(h,'XData',1:length(x),'YData',x); end samer@0: function proc_mat(x), samer@0: dom=1:size(x,1); samer@0: for i=1:length(h) samer@0: set(h(i),'XData',dom,'YData',x(:,i)); samer@0: end samer@0: if af, drawnow; end samer@0: end samer@0: end