function  [linelabels,h_main] = redraw_grid(xsel,sequence,Offset,labelpos,diagonalline,sizey,mainband);

linelabels = [];
hold on
for k=1:length(xsel)
    if (xsel(k)>0)
        yselpick = xsel(k);
        endpoint=diagonalline(round(yselpick));
        linelabels(k,1) =plot( [0 endpoint],[yselpick yselpick]);
        linelabels(k,2) =plot( [endpoint endpoint],[yselpick sizey]);
        letter = sequence(k-Offset); nucleotidecolor = getnucleotidecolor( letter);
        set(linelabels(k,:),'color',  nucleotidecolor,'clipping','on');
    end
end

h_main = plot([mainband mainband],[1 sizey],'k');

