function vertex_plot ( v, color, number )

%*****************************************************************************80
%
%% vertex_plot() plots a polyiamond from its vertex list.
%
%  Discussion:
%
%    The vertex list of a polyiamond gives the IJ coordinates of the
%    polygonal vertices, in counterclockwise order.
%
%    The user should call "clf()" before this function.
%    More plotting commands may be issued if preceded by the "hold on"
%    command.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer V(VN,2): the vertices, in counterclockwise order.
%
%    color COLOR: the color to use.
%
%    logical NUMBER: true if the triangle indices should be printed.
%

%
%  Determine the extent of the parallelogram grid.
%
  imin = min ( v(:,1) );
  imax = max ( v(:,1) );
  jmin = min ( v(:,2) );
  jmax = max ( v(:,2) );
%
%  Ensure inclusion of origin.
%
  imin = min ( imin, 0 );
  imax = max ( imax, 0 );
  jmin = min ( jmin, 0 );
  jmax = max ( jmax, 0 );
%
%  Consider each triangle in the parallelogram grid.
%  If it is in the region, color it in.
%
  hold ( 'on' );

  r = 1.0;
  counter = 0;
  for j = jmin + 1 : jmax + 1
    for i = imin + 1 : imax + 1
      for k = 0 : 1
        ijk = [ i, j, k ];
        if ( vertex_contains_ijk ( v, ijk ) )
          counter = counter + 1;
          if ( number )
            label = sprintf ( '%d', counter );
          else
            label = '';
          end
          ijk_fill ( ijk, r, color, label );
        end
      end
    end
  end
%
%  Mark the origin.
%
  plot ( 0.0, 0.0, 'k.', 'markersize', 35 );

  hold ( 'off' );

  axis ( 'equal' );
  axis ( 'off' );

  return
end

