IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
data_draw_scatter_3d2.m
Go to the documentation of this file.
1 %>@ingroup datasettools
2 %>@file
3 %>@brief Draws 3-D scatter plot-ellipse walls
4 
5 %> @param data dataset
6 %> @param idxfea What features to use. Numbers point to columns in @c data.X
7 %> @param confidences a list of percentages (]0, 1[) for the confidence ellipses
8 %> @param flags_min 3D boolean vector that controls where the walls will be drawn
9 %> @return <em>[data]</em>
10 %> @return <em>[data, handles]</em>. handles: handles for the legends
11 %> @param ks = [0.2, 0.5] a two-element vector with multipliers so that the axis limits take a distance from the points minima and maxima.
12 %> The first element refers to the minima, and the second refers to the maxima.
13 %> @param flag_wallpoints = 0. Whether to plot the point projections onto the walls
14 function varargout = data_draw_scatter_3d2(data, idxfea, confidences, flags_min, ks, flag_wallpoints)
15 
16 if ~exist('confidences', 'var')
17  confidences = [];
18 end;
19 
20 if ~exist('flags_min', 'var')
21  flags_min = [0, 0, 1];
22 end;
23 
24 if ~exist('ks', 'var')
25  ks = [0.2, 0.5];
26 end;
27 
28 if ~exist('flag_wallpoints', 'var')
29  flag_wallpoints = 0;
30 end;
31 
32 
33 if numel(idxfea) < 3
34  irerror('idx_fea must have 3 elements!');
35 end;
36 if any(idxfea > data.nf)
37  irerror(sprintf('Dataset has only %d feature(s)!', data.nf));
38 end;
39 
40 handles = draw3d2_core(data, idxfea, confidences, flags_min, ks, flag_wallpoints);
41 legend(handles, data_get_legend(data));
42 draw3d2_adjust(data, idxfea, flags_min, ks);
43 
44 
45 if nargout <= 1
46  varargout = {data};
47 elseif nargout == 2
48  varargout = {data, handles};
49 end;
function draw3d2_core(in data, in idxfea, in confidences, in flags_min, in ks, in flag_wallpoints)
function irerror(in s)
function data_draw_scatter_3d2(in data, in idxfea, in confidences, in flags_min, in ks, in flag_wallpoints)
function data_get_legend(in data)
function draw3d2_adjust(in data, in idxfea, in flags_min, in ks)