IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
data_draw_3dhist.m
Go to the documentation of this file.
1 %>@ingroup datasettools
2 %> @file
3 %> @brief Draws the 3D figure: per-feature Histograms
4 function data = data_draw_3dhist(data, cc)
5 
6 X = data.X;
7 nf = size(X, 2);
8 min_data = min(min(X));
9 max_data = max(max(X));
10 
11 hist_no_divisions = 100;
12 hist_space = linspace(min_data, max_data, hist_no_divisions);
13 mm = zeros(hist_no_divisions, nf);
14 for i = 1:nf
15  mm(:, i) = hist(X(:, i), hist_space);
16 end;
17 
18 % Scaling between 0 and 1
19 mm = mm/max(max(mm))*100;
20 
21 
22 % mm = [zeros(1, nf); mm; zeros(1, nf)];
23 % mm = [zeros(size(mm, 1), 1) mm zeros(size(mm, 1), 1)];
24 
25 
26 if ~exist('cc', 'var')
27  cc = mm;
28 end;
29 
30 
31 [xx, yy] = meshgrid([data.fea_x], hist_space);
32 
33 if length(cc) == 1
34  cc = ones(size(xx, 1), size(xx, 2))*cc;
35 end;
36 
37 
38 surf(xx, yy, mm, cc);
39 format_xaxis(data);
40 set(gca, 'YLim', [min_data, max_data]);
41 zlabel('%');
42 shading('interp');
43 format_frank();
44 
45 % data.hist_space = hist_space;
46 % data.mm = mm;
function format_frank(in F, in scale, in handles)
function format_xaxis(in par)
function data_draw_3dhist(in data, in cc)