function caffeine_scatter ( )

%*****************************************************************************80
%
%% CAFFEINE_SCATTER: scatter plot of cataract incidence / caffeine intake.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 July 2018
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CAFFEINE_SCATTER:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s:\n', version ( ) );
  fprintf ( 1, '  Read a data file of cataract incidence versus caffeine intake.\n' );
  fprintf ( 1, '  Display the data as a scatter plot.\n' );
%
%  Load the data.
%
  data = load ( 'caffeine_data.txt' );

  [ m, n ] = size ( data );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Read %d data records from the file.\n', m );
%
%  Split the data, for clarity.
%
  cataracts = data(:,1);
  caffeine = data(:,2);
%
%  Draw the scatter graph.
%
  scatter ( caffeine, cataracts, 75, 'filled' );
%
%  Add grid lines.
%
  grid on
%
%  Add text.
%
  title ( 'Caffeine and cataracts', 'fontsize', 24 )
  xlabel ( '<-- Daily caffeine intake (mg) -->', 'fontsize', 16 )
  ylabel ( '<-- Blindness due to cataracts (%) -->', 'fontsize', 16 )

  pause ( 5 )
%
%  Save a copy of the plot as a PNG file.
%
  filename = 'caffeine_scatter.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics data saved in "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CAFFEINE_SCATTER:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  return
end

