Newer
Older
Yves Gouriou
committed
function plot_Sample( hTsgGUI, hPlotAxes )
Yves Gouriou
committed
% Function to plot :
% 1 - SAMPLE/TSG differences on axes 2
% 2 - Raw tsg and tsg -adjusted on axe 3
% 3 - do not draw anything on axes 1
%
% Input
% -----
% hTsgGUI ........ Handel to the user interface
Yves Gouriou
committed
% hPlotAxes ...... Handels to the graphic axes
%
% 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);
Yves Gouriou
committed
% Plot Sample/TSG differences on axe 2
% ------------------------------------
axes(hPlotAxes(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')
Yves Gouriou
committed
% ----------------------------------------------
if strcmp( state, 'on')
% plot tsg salinity sample with right code/color
% ----------------------------------------------
ind = find(sample.SSPS_QC == code );
Yves Gouriou
committed
plot(hPlotAxes(2), sample.DAYD(ind), sample.SSPS_DIF(ind), strcat('.', color));
end
end
hold off;
% Plot tsg.SSPS and tsg.SSPS_ADJUSTED on axes 3
Yves Gouriou
committed
% ---------------------------------------------
plot_TsgAdjusted( hTsgGUI, hPlotAxes );
Yves Gouriou
committed
% Formatted x-TIME axes
% ---------------------
Yves Gouriou
committed
set(hPlotAxes(2), 'Xlim', [tsg.DAYD(1)-1 tsg.DAYD(end)+1]);
Yves Gouriou
committed
datetick(hPlotAxes(1), 'x', 'keeplimits');
datetick(hPlotAxes(2), 'x', 'keeplimits');
datetick(hPlotAxes(3), 'x', 'keeplimits');
% Write some 'Y' label
% ------------------
Yves Gouriou
committed
set(get(hPlotAxes(2), 'Ylabel'), 'String', 'Salinity Difference');
% Make the axes visible
% ---------------------
Yves Gouriou
committed
set(hPlotAxes(1), 'Visible', 'on' );
set(hPlotAxes(2), 'Visible', 'on' );
set(hPlotAxes(3), 'Visible', 'on' );
% The 3 axes will behave identically when zoomed and panned
% ---------------------------------------------------------
Yves Gouriou
committed
linkaxes([hPlotAxes(1),hPlotAxes(2),hPlotAxes(3)], 'x');