function p00_plot_test ( )

%*****************************************************************************80
%
%% p00_plot_test() plots the functions.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    16 March 2026
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'p00_plot_test():\n' );
  fprintf ( 1, '  plot the optimization functions.\n' );
  fprintf ( 1, '\n' );

  test_num = p00_test_num ( );

  for test = 1 : test_num

    [ a, b ] = p00_interval ( test );
    x = linspace ( a, b, 101 );
    fx = p00_f ( test, x );
    xm = p00_sol ( test );
    fxm = p00_f ( test, xm );

    clf ( );
    grid ( 'on' );
    hold ( 'on' );
    plot ( [a,b], [0.0,0.0], color = 'k' );
%
%  Trick the plotter into always clearly displaying the line y=0
%  by adding an invisible line a little below it.
%
    plot ( [a,b], [-0.1,-0.1], color = 'w' );
    plot ( x, fx, linewidth = 3, color = 'b' );
    plot ( xm, fxm, '.', markersize = 20, color = 'r' );
    hold ( 'off' );
    s = sprintf ( 'p%02d', test );
    title ( s );
    filename = sprintf ( 'p%02d.png', test );
    print ( '-dpng', filename );
    fprintf ( 1, '  Graphics saved as "%s"\n', filename );
    close ( );

  end

  return
end

