3 %> @brief Draws loadings curves with many options
5 %> @param x [nf] x-axis values.
6 %> @param L [nf][number_of_loadings] loadings matrix.
7 %> @param x_hint =[]. [nf] x-axis values. If not passed or empty, uses @a x
if @a hint is passed.
8 %> @param hint [nf]
"hint" curve that helps the reading of the loadings. If not passed or empty, no hint curve is drawn.
9 %> @param legends =[] One legend per loadings curve. If not passed, no legend is drawn.
10 %> @param flag_abs =0 Whether to take the absolute value of the loadings matrix.
11 %> @param peakd =[] Peak Detector
object.
12 %> @param flag_trace_minalt =0 Whether to draw the threshold line. Only works
if @a threshold is passed.
13 %> @param flag_draw_peaks =0 Whether to mark the detected peaks in the figure.
14 %> @param flag_print_peaks =0 Whether to print detected peaks on the command line window.
15 %> @param flag_histogram =0 Whether to plot line or histogram.
16 %> @param flag_envelope =0 If
true, will detect all peaks,
do spline interpolation and plot
this instead
17 %> @param flag_bmtable =0 Alternative view. If
true, a completely different thing will be done: a @ref
bmtable will be created. Note that the
peakdetector must be provided
18 %> @param colorindexes =[] If passed, will use indexes to find colors and markers. Otherwise, will assume [1, 2, 3, ...]
19 function draw_loadings_pl(x, L, x_hint, hint, legends, flag_abs, peakd, colorindexes)
21 if ~exist(
'x_hint',
'var') || isempty(x_hint)
24 if ~exist('hint', 'var') || isempty(hint)
27 if ~exist('legends', 'var')
30 if ~exist('peakd', 'var')
33 if ~exist('flag_abs', 'var') || isempty(flag_abs)
39 if ~exist('colorindexes', 'var') || isempty(colorindexes)
64 dshint.fea_x = x_hint;
65 dshint = dshint.assert_fix();
73 bl.L_fea_names = legends;
77 % Legends for the figure.
bmtable will use dataset title
as legend
79 % dss will be passed to
bmtable as datasets. The only property that
bmtable accesses is .title anyway.
82 dss(i).title = sprintf('Curve %s', i);
84 dss(i).title = legends{i};
91 bm.peakdetectors = {peakd};
96 bm.data_hint = dshint;
100 bm.grid{i, 1} =
setbatch(
struct(), {
'i_block', 1,
'i_dataset', i,
'i_peakdetector', 1,
'i_art', i,
'i_unit', 1,
'params', {
'idx_fea', i}});
102 bm.rowname_type =
'dataset';
function find_marker(in i)
function find_color(in i)
Art stuff for BioMarker Tables.
function setbatch(in o, in params)
Loadings vector specified directly.
Analysis Session (AS) base class.
function draw_loadings_pl(in x, in L, in x_hint, in hint, in legends, in flag_abs, in peakd, in colorindexes)