IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
data_draw_hachures.m
Go to the documentation of this file.
1 %>@ingroup datasettools
2 %>@file
3 %>@brief Draws class means with hachured aread behind to give an idea of variability
4 
5 %> @param data Dataset
6 function data_draw_hachures(data)
7 fig_assert();
8 
9 
10 ymin = Inf;
11 ymax = -Inf;
12 for i = 1:data.nc
13  X = data.X(data.classes == i-1, :);
14  curve = mean(X, 1);
15  stds = std(X, 1);
16 
17  ymin = min([ymin, curve-stds]);
18  ymax = max([ymax, curve+stds]);
19 
20 
21 
22  curve = mean(X, 1);
23  stds = std(X, 1);
24 
25  draw_stdhachure(data.fea_x, curve, stds, find_color(i));
26  hold on;
27 
28  hh(i) = plot(data.fea_x, curve, 'Color', find_color(i), 'LineWidth', scaled(3));
29 end;
30 
31 if ~isempty(hh)
32  legend(hh, data_get_legend(data));
33 end;
34 
35 ylabel([data.yname, iif(~isempty(data.yunit), sprintf(' (%s)', data.yunit), '')]);
36 format_xaxis(data);
37 format_ylim([ymin, ymax]);
38 format_frank();
function find_color(in i)
function data_draw_hachures(in data)
function data_get_legend(in data)
function scaled(in i)
function iif(in cond, in x1, in x2)
function format_ylim(in yy)
function format_frank(in F, in scale, in handles)
function draw_stdhachure(in xaxis, in curve, in stds, in color)
function fig_assert()
function format_xaxis(in par)