function p00_boundary_plot ( test, h, show_nodes, filename )

%*****************************************************************************80
%
%% p00_boundary_plot() plots the boundary of a region.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 May 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer TEST, the number of the problem.
%
%    real H, the maximum size of a segment of the boundary.
%    This controls how smoothly curved sections of the boundary will be drawn.
%
%    logical SHOW_NODES: true if the nodes are to be displayed.
%
%    string FILENAME, the name of the EPS file to create.
%
  m = 2;

  clf ( );

  hold ( 'on' );
%
%  Determine the range of the points.
%
  segment_num = p00_boundary_segment_num ( test );

  for segment = 1 : segment_num

    segment_length = p00_boundary_segment_length ( test, segment, h );

    if ( segment_length <= 0 )
      continue
    end

    boundary = p00_boundary_segment ( test, segment, m, segment_length );

    if ( show_nodes )
      plot ( boundary(1,:), boundary(2,:), 'bo', 'markersize', 10 );
    end

    plot ( boundary(1,:), boundary(2,:), 'r-', 'linewidth', 2 );

  end

  hold ( 'off' );

  axis ( 'equal' );

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

  return
end
