function plotedges_L1tri(nodes,edgeNodes,legend)

% plotedges_L1tri(nodes,edgeNodes,legend)

nedges = size(edgeNodes,2);

figure
hold on
for i=1:nedges
    ei = edgeNodes(:,i);

    xi1 = nodes(:,ei(1));
    xi2 = nodes(:,ei(2));
           
    plot([xi1(1),xi2(1)],[xi1(2),xi2(2)]);
    
    xCRi = 0.5*(xi1+xi2);

    if (legend==1)
        text(xi1(1),xi1(2),int2str(ei(1)));
        text(xi2(1),xi2(2),int2str(ei(1)));
        text(xCRi(1),xCRi(2),int2str(i));
    end
end
hold off
