% Set up plot for exploring relationships between data using data linking &
% brushing.
%
% Assumes data has been interpolated to common time base as in
% LR_interpolate_to_common_timebase 
%
% Driver variables:  increment and ilim
%
% e.g. to plot the first of several days...
%    day = 0; 
%    nn = length(ct); 
%    days = ct(nn)-ct(1); 
%    ilim = [round(nn*day/days+1) round(nn*(day+1)/days)];

if ~exist('increment')
    increment = 1;
end;
if ~exist('ilim')
    ilim = [1 length(ct)];
end;

index = ilim(1):increment:ilim(2);  % Can adjust here to plot less data if need be...

figure; 

% Plot section...
subplot(3, 1, 1);
PlotColorPoints(index, cdep(index), cchl(index), jet, 20, 'log')
hold on
plot(index, cdep(index), 'linestyle', 'none');
set(gca,'YDir','reverse');

subplot(3, 1, 2);
PlotColorPoints(index, cdep(index), c650(index), jet, 20, 'log')
hold on
plot(index, cdep(index), 'linestyle', 'none');
set(gca,'YDir','reverse');

% Do parameter vs parameter plots...
subplot(3,4,9);
plot3(c650(index), cchl(index), index, '.', 'MarkerSize', 0.5); view(0, 90);
xlabel('bs650'); ylabel('chl');

subplot(3,4,10);
plot3(c650(index), c470(index), index, '.', 'MarkerSize', 0.5); view(0, 90);
xlabel('bs650'); ylabel('bs470');

subplot(3,4,11);
plot3(cpar(index), cchl(index), index, '.', 'MarkerSize', 0.5); view(0, 90);
xlabel('par'); ylabel('chl');

subplot(3,4,12);
plot3(ctemp(index), csalt(index), index, '.', 'MarkerSize', 0.5); view(0, 90);
xlabel('T'); ylabel('S');