function vykresli_sit_MHP(x,e,legend)

% vykresli_sit_MHP(x,e,legend)
%            displays a triangulation.

ne = size(e,2);

figure
hold on
for i=1:ne
    ei = e(:,i);

    xi1 = x(:,ei(1));
    xi2 = x(:,ei(2));
       
    plot([xi1(1),xi2(1)],[xi1(2),xi2(2)]);

    if (legend==1)
        text(xi1(1),xi1(2),int2str(ei(1)));
        text(xi2(1),xi2(2),int2str(ei(2)));
        
        t = text((1/2)*(xi1(1)+xi2(1)),(1/2)*(xi1(2)+xi2(2)),int2str(i));
        set(t,'Color',[1 0 0]);
    end
end
hold off
