%%
tr = jarkus_transects('url', '..\data\jarkus.nc', 'output', {'id'});
ID = tr.id;

if ~exist('iruns', 'var')
    iruns = [0 2 3];
end

zones = 1:4;

if ~exist('model', 'var')
    model = 'xbeach';
end

for irun = iruns
    for zone = zones
        iplot = (find(irun==iruns)-1) * length(zones) + find(zone==zones);
        subplot(length(iruns), length(zones), iplot,...
            'nextplot', 'add')
        desb_plot_corr_all(...
            'model', model,...
            'irun', irun,...
            'zone', zone);
        if mod(iplot,length(zones)) == 1
            ylabel('correlation \rho')
        end
    end
end
set(findobj('type', 'axes'), 'YLim', [-1 1])

% turn off xticklabels for all but the lowest row
th = findobj('tag', 'XTickLabel');
ah = cell2mat(get(th, 'parent'));
ps = cell2mat(get(ah, 'position'));
set(th(ps(:,2)>min(ps(:,2))), 'visible', 'off')

tith = cell2mat(get(unique(ah), 'title'));
ahth = cell2mat(get(tith, 'parent'));
psth = cell2mat(get(ahth, 'position'));
set(tith(psth(:,2)<max(psth(:,2))), 'visible', 'off')
