% plotmeshtest.m is designed only for small meshes,
% it will work for large meshes, but the text will be cluttered.

  % ... set some scalars:
  nelem = size (t, 2); % = number of elements
  nvert = size (p, 2); % = number of vertices

  % ... Test everything by putting numbers down, specifically:
  %     (1) print element numbers at the center-of-gravities,
  %     (2) print vertex numbers at the vertices.
  % ... compute centers of gravity:
  xc = (1/3) * (p(1,t(1,:)) + p(1,t(2,:)) + p(1,t(3,:)));
  yc = (1/3) * (p(2,t(1,:)) + p(2,t(2,:)) + p(2,t(3,:)));
  tc = int2str ([1 : nelem]');
  % ... plot everything:
  figure;
  H = pdemesh (p,e,t); % plot mesh
  text (xc, yc, tc, 'FontSize',20, ...
        'HorizontalAlignment','center', 'VerticalAlignment','middle');
  xv = p(1,:);
  yv = p(2,:);
  tv = int2str ([1 : nvert]');
  text (xv, yv, tv, 'FontSize',18, ...
        'FontAngle','italic', 'FontWeight','bold', ...
        'HorizontalAlignment','left', 'VerticalAlignment','top');
  grid on;
  axis equal;
  xlabel ('x'); ylabel ('y');

