function president_heights_barh ( )

%*****************************************************************************80
%
%% president_heights_barh creates a horizontal bar chart, using the readtable command.
%
%  Discussion:
%
%    Standard MATLAB file reading functions like load() and csvread()
%    cannot read files of data in columns when some data is numeric, and
%    some is text.
%
%    The readtable() function handles this case, but creates a special
%    structure called a table, to store the data.  Individual columns
%    can be accessed using the same curly bracket indexing used for
%    cell arrays.  There are probably other wonderful features.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    28 April 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'president_heights_barh\n' );
  fprintf ( 1, '  MATLAB version.\n' );
  fprintf ( 1, '  Create a horizontal bar plot of the height in inches of US presidents.\n' );
%
%  Read the file.
%
  data = readtable ( 'president_heights_data.csv' );
%
%  Column 1 is Name, Column 2 is height in inches.
%
  barh ( data{end:-1:1,2} );
%
%  Set 45 ticks, so that we have a spot for each name to appear in.
%
  yticks ( 1 : 45 );
  set ( gca, 'yticklabel', data{end:-1:1,1} );

  xlabel ( '<-- Height (inches) -->', 'Fontsize', 16 );
  title ( 'US President Heights', 'Fontsize', 16 );
  grid ( 'on' );
  filename = 'president_heights_barh.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'president_heights_barh\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

