function plotLine(type)

global FileName
global BatchResults
global Selection
global MapExtent
global Line

nrYear  = get(findobj('Tag','lstYears'),'Value');
%nrParam = get(findobj('Tag','lstParam'),'Value');
nrMethod = get(findobj('Tag','lstMethod'),'Value');

%if nrParam == 1 %Xr
    ColumnX = 12;
    ColumnY = 13;
%else %Xp
%    ColumnX = 9;
%    ColumnY = 10;
%end
theColors =['b','g','r','c','m','y','k','w'];

if strcmp(type,'all')
    n = length(Selection.Percentages);
    LegendAll={};
    nr = 0;
    
    [X,map] = imread(FileName);
    hold off
    tst = image(X); axis equal;
    hold on
    
    for i=1:n
        Results = getFromMatrixFile(BatchResults,1,Selection.Years(nrYear),...
                           17,Selection.Percentages(i),...
                           ColumnX,'relop','>=','value',MapExtent.Xmin,...
                           ColumnX,'relop','<=','value',MapExtent.Xmax,...
                           ColumnY,'relop','>=','value',MapExtent.Ymin,...
                           ColumnY,'relop','<=','value',MapExtent.Ymax);
        if ~isempty(Results)
            nr = nr + 1;
            XResult = getFromMatrixFile(Results,ColumnX);
            YResult = getFromMatrixFile(Results,ColumnY);

            [x,y] = setImageCoordinates(XResult,YResult);

            ColorName = theColors(i);
            lh(nr)        = plot(x,y,'Linewidth',3,'Color',ColorName);
            strLegend{nr} =[Selection.Method ':' num2str(Selection.Years(nrYear)) ' and 1/' num2str(Selection.Exceedances(i))];
            legend(lh,strLegend,'Location','NorthWest')
        end
    end
else
    nrExc   = get(findobj('Tag','lstExceedance'),'Value');
    Results = getFromMatrixFile(BatchResults,1,Selection.Years(nrYear),...
                           17,Selection.Percentages(nrExc),...
                           ColumnX,'relop','>=','value',MapExtent.Xmin,...
                           ColumnX,'relop','<=','value',MapExtent.Xmax,...
                           ColumnY,'relop','>=','value',MapExtent.Ymin,...
                           ColumnY,'relop','<=','value',MapExtent.Ymax);
    if ~isempty(Results)
        XResult = getFromMatrixFile(Results,ColumnX);
        YResult = getFromMatrixFile(Results,ColumnY);

        [x,y] = setImageCoordinates(XResult,YResult);

        ColorName = theColors(nrExc);

        [X,map] = imread(FileName);
        hold off
        tst = image(X);
        axis equal
        hold on
        %plot(x,y,'r>-','Linewidth',3,'Color',[.5 .5 .5],'MarkerEdgeColor',[1 1 1],'MarkerFaceColor','blue','MarkerSize',10)
        lh = plot(x,y,'Linewidth',3,'Color',ColorName);
    
        strLegend=[Selection.Method ':' num2str(Selection.Years(nrYear)) ' and 1/' num2str(Selection.Exceedances(nrExc))];
        legend(lh,strLegend,'Location','NorthWest')
    end
end
