IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
vis_crossloadings.m
Go to the documentation of this file.
1 %> @brief Loadings vector of an @ref as_crossc
3  properties
4  data_input;
5  data_hint = [];
6  idx_fea = 1;
7  flag_trace_minalt = 0;
8  flag_abs = 0;
10  flag_envelope = 0;
11  flag_bmtable = 0;
12  end;
13 
14  methods
15  function o = vis_crossloadings(o)
16  o.classtitle = 'Loadings';
17  o.inputclass = 'log_as_crossc';
18  end;
19  end;
20 
21  methods(Access=protected)
22  function out = do_use(o, obj)
23  out = [];
24  nb = length(obj.blocks);
25  l = 0;
26  ymax = -Inf;
27  ymin = Inf;
28 
29  % Makes a fader color
30  color1 = rgb(find_color(1));
31  color1 = color1*0.3+max(color1)*0.7;
32 
33  for i = 1:nb
34  block = obj.blocks{i};
35  temp = block.L(:, o.idx_fea);
36  if o.flag_abs
37  temp = abs(temp);
38  else
39  ymin = min([temp', ymin]);
40  end;
41  ymax = max([temp', ymax]);
42  plot(block.L_fea_x, temp', 'Color', color1, 'LineWidth', scaled(1)); % yeah it is 1
43  hold on;
44  l = l+temp;
45  end;
46  l = l/nb;
47 
48  flag_p = ~isempty(o.peakdetector);
49  if ~isempty(o.data_hint)
50  hintx = o.data_hint.fea_x;
51  hinty = mean(o.data_hint.X, 1);
52  else
53  hintx = [];
54  hinty = [];
55  end;
56 
57  draw_loadings(obj.blocks{1}.L_fea_x, l, hintx, hinty, [], o.flag_abs, ...
58  o.peakdetector, o.flag_trace_minalt, flag_p, flag_p);
59  temp = struct();
60  format_xaxis(obj.blocks{1});
61  if o.flag_abs
62  y0 = 0;
63  y1 = ymax*1.05;
64  else
65  yspan = ymax-ymin;
66  y0 = ymin-yspan*0.05;
67  y1 = ymax+yspan*0.05;
68  end;
69  set(gca, 'YLim', [y0, y1]);
70  set_title(o.classtitle, obj);
71  make_box();
72  end;
73  end;
74 end
Loadings vector of an as_crossc.
function find_color(in i)
Peak Detector.
Definition: peakdetector.m:6
Visualization base class.
Definition: vis.m:4
Base Block class.
Definition: block.m:2
Log generated by an as_crossc.
Definition: log_as_crossc.m:8
Cross-calculation Analysis Session.
Definition: as_crossc.m:19