function plotgrid(x,e)

% plotgrid(x,e)
%            It draws discretization of the grid.

ne = max(size(e));

figure
hold on

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

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

hold off
