Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function plot_Sample( hTsgGUI, hAxes )
%
% Function to plot the Salinity from sample meausrements
%
% Input
% -----
% hTsgGUI ........ Handel to the user interface
% hAxes .......... Handels to the graphic axes
%
% Output
% ------
%
% Retrieve named application data
% -------------------------------
sample = getappdata( hTsgGUI, 'sample');
tsg = getappdata( hTsgGUI, 'tsg_data');
% get list of keys from hashtable tsg.qc.hash, defined inside
% tsg_initialisation.m
% -----------------------------------------------------------
qc_list = get(tsg.qc.hash);
axes(hAxes(2));
hold off;
% iterate (loop) on each key store inside hastable
% ------------------------------------------------
for i=1:numel(qc_list)
% get key and some values in hashtable
% ------------------------------------
key = qc_list{i};
state = get(tsg.qc.hash, key, 'state');
code = get(tsg.qc.hash, key, 'code');
color = get(tsg.qc.hash, key, 'color');
% plot only for valid context menu (set to 'on')
% -------------------------------_______-------
if strcmp( state, 'on')
% plot tsg salinity sample with right code/color
% ----------------------------------------------
ind = find(sample.SSPS_QC == code );
plot(hAxes(2), sample.DAYD(ind), sample.SSPS_DIF(ind), strcat('.', color));
end
end
hold off;
% Formatted x-TIME axes
% ---------------------
set(hAxes(2), 'Xlim', [tsg.DAYD(1)-1 tsg.DAYD(end)+1]);
datetick(hAxes(1), 'x', 'keeplimits');
datetick(hAxes(2), 'x', 'keeplimits');
datetick(hAxes(3), 'x', 'keeplimits');
% Write some 'Y' label
% ------------------
set(get(hAxes(2), 'Ylabel'), 'String', 'Salinity Difference');
% Make the axes visible
% ---------------------
set(hAxes(1), 'Visible', 'on' );
set(hAxes(2), 'Visible', 'on' );
set(hAxes(3), 'Visible', 'on' );
% The 3 axes will behave identically when zoomed and panned
% ---------------------------------------------------------
linkaxes([hAxes(1),hAxes(2),hAxes(3)], 'x');
end