function mfs_pltelt(nofelt, elem);

# usage: mfs_pltelt(nofelt, elem)
#
# Input nofelt    Number of elements 
#       elem      Structure with element data
#
# The function plots 3-dimensional g2 elements.
#
# Description of the element structure:
#
#   elem.id                  Element identifier
#   elem.nodes(:)            Identifiers of element nodal points
#   elem.coor(:, 3)          Coordinates of element nodal points
#   elem.ects(:)             Element connectivity table
#
# ------------------------------------------------------------------------

  global pltparm;


# Plot elements

  coor = [elem.coor];
  line(coor(:, 1 : 3 : end), coor(:, 2 : 3  : end),
       coor(:, 3 : 3 : end), "color", pltparm.color);

# Plot element identifiers

  if (pltparm.eltid == 1)
     for nel = 1 : nofelt
         x = mean(elem(nel).coor(:, 1));
         y = mean(elem(nel).coor(:, 2));
         z = mean(elem(nel).coor(:, 3));
         label = sprintf("%i", elem(nel).id);
         text(x, y, z, label, "fontsize", pltparm.fontsize);
     end
  end

end
