Mercurial > hg > ltpda
comparison m-toolbox/classes/@plotter/plot.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % PLOT call plot on each data object. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: PLOT call plot on each data object. | |
5 % | |
6 % CALL: hfig = plotter.plot(pl); | |
7 % | |
8 % OUTPUTS: | |
9 % hfig - an array of figure handles | |
10 % | |
11 % <a href="matlab:utils.helper.displayMethodInfo('plotter', 'plot')">Parameters</a> | |
12 % | |
13 % VERSION: $Id: plot.m,v 1.2 2011/03/28 12:45:39 hewitson Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 function plot(varargin) | |
17 | |
18 % Check if this is a call for parameters | |
19 if utils.helper.isinfocall(varargin{:}) | |
20 varargout{1} = getInfo(varargin{3}); | |
21 return | |
22 end | |
23 | |
24 % Collect input variable names | |
25 in_names = cell(size(varargin)); | |
26 for ii = 1:nargin,in_names{ii} = inputname(ii);end | |
27 | |
28 % Get the plotter calling object | |
29 plotter = utils.helper.collect_objects(varargin(:), 'plotter'); | |
30 | |
31 % Collect input plists | |
32 pl = utils.helper.collect_objects(varargin(:), 'plist'); | |
33 pl = combine(pl, getDefaultPlist); | |
34 | |
35 hfig = []; | |
36 for kk=1:numel(plotter.data) | |
37 | |
38 d = plotter.data(kk); | |
39 | |
40 % Try to call the data class's plot method | |
41 try | |
42 d.plot; | |
43 | |
44 % Collect the handles | |
45 drawnow; | |
46 hfig = [hfig gcf]; | |
47 | |
48 catch Me | |
49 warning('Class %s has no plot function', class(d)); | |
50 end | |
51 | |
52 end | |
53 | |
54 | |
55 end | |
56 | |
57 %-------------------------------------------------------------------------- | |
58 % Get Info Object | |
59 %-------------------------------------------------------------------------- | |
60 function ii = getInfo(varargin) | |
61 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
62 sets = {}; | |
63 pl = []; | |
64 else | |
65 sets = {'Default'}; | |
66 pl = getDefaultPlist; | |
67 end | |
68 % Build info object | |
69 ii = minfo(mfilename, 'plotter', 'ltpda', utils.const.categories.output, '$Id: plot.m,v 1.2 2011/03/28 12:45:39 hewitson Exp $', sets, pl); | |
70 end | |
71 | |
72 %-------------------------------------------------------------------------- | |
73 % Get Default Plist | |
74 %-------------------------------------------------------------------------- | |
75 function pl_default = getDefaultPlist() | |
76 pl_default = plist(); | |
77 | |
78 end | |
79 | |
80 % END |