function mortality_cdf_plot ()

%*****************************************************************************80
%
%% mortality_cdf_plot() plots mortality cumulative density function.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 November 2020
%
%  Author:
%
%    John Burkardt
%

%
%  Get the data.
%
  [ age, total_cdf, male_cdf, female_cdf ] = mortality_cdf ( ); 
%
%  Plot the data.
%
  figure ( );
  clf ( );
  hold ( 'on' );
    plot ( age, total_cdf, 'k-', 'linewidth', 3 );
    plot ( age, male_cdf, 'b-', 'linewidth', 3 );
    plot ( age, female_cdf, 'r-', 'linewidth', 3 );
  hold ( 'off' );
  xlabel ( '<-- Age at death -->' );
  ylabel ( '<-- Probability of death -->' );
  title ( 'Probability of death at or before given age, in 2007' );
  legend ( 'Total', 'Male', 'Female' );
  grid ( 'on' );

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

  return
end
 
