clc
close all 
clear all

%% 
close all

make_it_tight = true;
subplot = @(m,n,p) subtightplot (m, n, p, [0.045 0.065], [0.15 0.04], [0.065 0.03]);
if ~make_it_tight,  clear subplot;  end

addpath('./LHSH/')
soil_type = {'sand','loamy sand','sandy loam','silt loam',...
    'silt','loam','sandy clay loam','silty clay loam',...
    'clay loam','sandy clay','silty clay','clay',...
    'organic material','water','bedrock','other'};

load diff_stats_LH.mat
load diff_stats_SH.mat
load diff_stats_SM.mat

figure
set(gcf,'PaperPositionMode', 'auto');
set(gcf,'Position', [0 0 700 450])
subplot(2,2,1)
plot_bar_with_errorbar(diff_stats_SM);set(gca,'xticklabel',{[]}); 
title_left( 'a) SM\_2m '); ylim([-0.06 0.1]);
ylabel('SM diff. [m]')
xticks([1:16]);

subplot(2,2,3)
plot_bar_with_errorbar(diff_stats_LH); 
title_left( 'b) LH'); ylim ([-7 10]); 
ylabel('LH diff. (W m^{-2})')
xticks([1:16]);
xticklabels(soil_type); 
xtickangle(45);

subplot(2,2,4)
plot_bar_with_errorbar(diff_stats_SH);
title_left( 'c) SH');ylim ([-7 10]); 
ylabel('SH diff. (W m^{-2})')

xticks([1:16]);
xticklabels(soil_type); 
xtickangle(45);

save_fig_name = 'SM_TBL_SM_total_DIFF_BAR_PLOT';
print('-depsc', save_fig_name);
