function snowfall_histogram ( )

%*****************************************************************************80
%
%% SNOWFALL_HISTOGRAM plots a histogram of yearly total snowfalls.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 July 2018
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'SNOWFALL_HISTOGRAM:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s:\n', version ( ) );
  fprintf ( 1, '  Make a histogram of yearly total snowfall data.\n' );

  data = load ( 'snowfall_data.txt' );

  [ m, n ] = size ( data );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  %d x %d data records read from file.\n', m, n );
%
%  For simplicity, copy column 10, and call it "inches".
%
  inches = data(:,10);
%
%  Create a histogram.
%
  bin_min = min ( inches );
  bin_max = max ( inches );
  bin_num = 20;
 
  [ bin_ave, bin_count ] = histogramize ( m, inches, bin_min, bin_max, bin_num );

  bar ( bin_ave, bin_count );

  grid on
  xlabel ( '<-- Total Yearly Snow in Inches -->' )
  ylabel ( '<-- Frequency -->' )
  title ( 'Yearly Snowfall in Michigan' )

  pause ( 5 )
%
%  Save graphics in file.
%
  filename = 'snowfall_histogram.png';
  print ( '-dpng', filename )
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'SNOWFALL_HISTOGRAM:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  return
end

