function word_plot_test ( )

%*****************************************************************************80
%
%% word_plot_test() tests word_plot().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 December 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'word_plot_test():\n' );
  fprintf ( 1, '  word_plot() plots a polyabolo from its boundary word.\n' );
%
%  Plot grids.
%
  for index = 1 : 4

    [ w, p ] = t_grid_word ( index );
    [ name, name2 ] = t_grid_name ( index );
%
%  Draw the grid.
%
    [ imin, imax, jmin, jmax ] = word_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 polyabolo on top of the grid.
%
    color = 'cyan';
    number = false;
    word_plot ( w, p, color, number );

    axis ( 'equal' );
    axis ( 'off' );
    label = sprintf ( 'word_plot: %s\n', name );
    label = s_escape_tex ( label );
    title ( label )
    hold ( 'off' );

    filename = sprintf ( 'word_plot_%s.png', name2 );
    print ( '-dpng', filename );
    fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  end
%
%  Plot tiles.
%
  for index = 1 : 4

    [ w, p ] = t_tile_word ( index );
    name = sprintf ( 'Tile %d', index );
    name2 = sprintf ( 'tile%d', index );
%
%  Draw the grid.
%
    [ imin, imax, jmin, jmax ] = word_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 polyabolo on top of the grid.
%
    color = 'cyan';
    number = false;
    word_plot ( w, p, color, number );

    axis ( 'equal' );
    axis ( 'off' );
    label = sprintf ( 'word_plot: %s', name );
    label = s_escape_tex ( label );
    title ( label )
    hold ( 'off' );

    filename = sprintf ( 'word_plot_%s.png', name2 );
    print ( '-dpng', filename );
    fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'word_plot_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

