function geyser_histogram ( )

%*****************************************************************************80
%
%% GEYSER_HISTOGRAM makes a histogram of geyser data.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 July 2018
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'GEYSER_HISTOGRAM\n' );
  fprintf ( 1, '  MATLAB/Octave version %s:\n', version ( ) );
  fprintf ( 1, '  Create a histogram of the time between eruptions\n' );
  fprintf ( 1, '  of the Old Faithful geyser.\n' );
%
%  Load the data.
%
  x = load ( 'geyser_data.txt' );

  [ m, n ] = size ( x );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  %d x %d data records read from file.\n', m, n );
%
%  Create a histogram.
%
  bin_min = min ( x(:,1) );
  bin_max = max ( x(:,1) );
  bin_num = 20;
 
  [ bin_ave, bin_count ] = histogramize ( m, x(:,1), bin_min, bin_max, bin_num );

  bar ( bin_ave, bin_count );

  grid on
  title ( 'Time between eruptions of Old Faithful' )
  xlabel ( 'Minutes' )
  ylabel ( 'Frequency' )

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

  return
end
