% plot series line 7
close all

% line = 7;

for line = 1:22
    year = 2009;
    month = 7;
    for i = 1: length(month)
        [cross_shore,altitude(:,i)] = combine_surveys(year,month(i),line);
        figure(str2num([num2str(line) '1']))
        plot(cross_shore,altitude(:,i),'b','linewidth',2,'markersize',4,...
            'DisplayName', datestr(datenum(num2str([month(i) year]),'mm yyyy'),'mmmm yy'));
        hold all;
        if i>1
            figure(str2num([num2str(line) '1']))

            plot(cross_shore,altitude(:,i)-altitude(:,1),...
                'DisplayName', ['\Delta until ' datestr(datenum(num2str([month(i) year]),'mm yyyy'),'mmmm yy')]);
            hold all
        end

    end
    year = 2010;
    month = 3;
    for i = 1: length(month)
        index_nr = i+min(size((altitude)));
        [cross_shore,altitude(:,index_nr)] = combine_surveys(year,month(i),line);
        figure(str2num([num2str(line) '1']))
        plot(cross_shore,altitude(:,index_nr),'r','linewidth',2,...
            'DisplayName', datestr(datenum(num2str([month(i) year]),'mm yyyy'),'mmmm yy'));
        hold all;
        hline(3,'-.m')
        hline(-0.65-(3+0.65),'-.m')
        if 0
            figure(str2num([num2str(line) '1']))

            plot(cross_shore,altitude(:,i+6)-altitude(:,1),...
                'DisplayName', ['\Delta until ' datestr(datenum(num2str([month(i) year]),'mm yyyy'),'mmmm yy')]);
            hold all
        end
    end
    set(gcf,'PaperOrientation','landscape','PaperPosition',[0.634518 0.634517 28.4084 19.715])
    legend show
    title(['Elevation along line ' num2str(line)])
    xlabel('Cross Shore [m]')
    ylabel('Elevation wrt NAP [m]')
    xlim([-300 1500])
    ylim([-10 15])
    grid on
    set(gcf,'PaperOrientation','landscape','PaperPosition',[0.634518 0.634517 28.4084 19.715])
print('-dpng',['./plot_series/quirijn_line' num2str(line) '.png'])
end
close all