function boundary_plot_test ( )

%*****************************************************************************80
%
%% boundary_plot_test() tests boundary_plot().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 June 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'boundary_plot_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  boundary_plot() plots a polyhex from its boundary word.\n' );

  for k = 1 : 7
    [ w, p ] = tetrahex_word ( k );
    label = tetrahex_name ( k );
    filename = [ label, '_boundary.png' ];
    boundary_plot_demo ( w, p, label, filename );
  end
%
%  Terminate.
%
  fprintf ( 1, 'boundary_plot_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
function boundary_plot_demo ( w, p, label, filename )

%*****************************************************************************80
%
%% boundary_plot_demo plots the boundary of a polyhex.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 June 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    W
%
%    P
%
%    LABEL
%
%    FILENAME
%


%
%  Draw the parallelogram grid.
%
  [ imin, imax, jmin, jmax ] = boundary_range ( w, p );
  imax = imax + 1;
  jmax = jmax + 1;

  clf ( );
  hold ( 'on' );
  r = 0.85;
  color_back = 'cyan';
  color_tri =  'yellow';
  number = false;
  grid_plot ( imin, imax, jmin, jmax, r, color_back, color_tri, number );
%
%  Draw the polyiamond.
%
  color = 'blue';
  number = true;
  boundary_plot ( w, p, color, number );

  axis ( 'equal' );
  axis ( 'off' );
  title ( label )
  hold ( 'off' );

  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end

