% Plot 4 subplots for s180 flood
% Nothing is plotted in 2 and 4 to achieve same size as s300 stats
% Subplot 1 - Total area vs ln(attenuation)
% Subplot 2 - Nothing
% Subplot 3 - Multiple linear regression (w/1&2) vs ln(attenuation)
% Subplot 4 - Nothing

clear

% Set colors
cmap = lines;
marker_color = cmap(1,:);
line_color = cmap(2,:);

% Load data

dir_root = ['/Users/Colin/Documents/MATLAB/DFlow/'...
    'influences_chap2/transform/'];

% Load s300 flood characteristics
load(strcat(dir_root,'matrix_lny_x_180.mat'));

% Load ln(attenuation) data
load(strcat(dir_root,'ln_y180_matrix.mat'));
load(strcat(dir_root,'qar_rate1000s180.mat'));

lny180 = ln_y180_matrix;

% Plot
f1 = figure(1);
set(f1,'color','white');

subplot(2,2,1);
mdl4 = fitlm(matrix_lny_x_180(:,4),lny180);
sp1 = plot(mdl4);
set(sp1(1), 'MarkerEdgeColor', marker_color);
set(sp1(2), 'Color',  line_color);
set(sp1(3),'Color', line_color);
set(sp1(4),'Color', line_color);
hold on 
ylabel('ln(\DeltaQAR)','Interpreter','tex');
xlabel({'Peak WSE -'; 'Mean Floodplain Elevation (m)'});
xlim([0 0.8]);
xticks([0 0.2 0.4 0.6 0.8]);
set(gca,'Fontsize',14);
legend('off')
title('')

subplot(2,2,3);
mdl42 = fitlm(matrix_lny_x_180(:,[2 4]),lny180);
sp2 = plot(mdl42);
set(sp2(1), 'MarkerEdgeColor', marker_color);
set(sp2(2), 'Color',  line_color);
set(sp2(3),'Color', line_color);
%set(sp2(4),'Color', line_color);
xlim([-0.15 -0.06]);
xticks([-0.15 -0.12 -0.09 -0.06]);
%xlabel('Fraction of area inundated','Interpreter','tex');
ylabel('ln(\DeltaQAR)','Interpreter','tex');
set(gca,'Fontsize',14);
legend('off')
title('')