function basketball_barh ( )

%*****************************************************************************80
%
%% basketball_barh creates a horizontal bar chart.
%
%  Discussion:
%
%    Octave doesn't have a function that can read CSV data that mixes
%    text and numerics, and so we have to use a function instead.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 July 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'basketball_barh\n' );
  fprintf ( 1, '  MATLAB/Octave version %s:\n', version ( ) );
  fprintf ( 1, '  Create a horizontal bar char from data read from\n' );
  fprintf ( 1, '  a function.\n' );
%
%  Read the data.
%
  [ id, name, position, height, weight, sponsorship, shoe, career, ...
    age ] = basketball_data ( );
%
%  We can plot the sponsorships, but getting labels on them is very awkward.
%  Plus not defined anywhere.  This is the best I could do.
%  It's annoying enough to make you switch majors to chemistry!
%
  barh ( sponsorship );
  set ( gca, 'yticklabel', { ...
    name(1,1:4), name(2,1:4), name(3,1:4), name(4,1:4), name(5,1:4), ...
    name(6,1:4), name(7,1:4), name(8,1:4), name(9,1:4), name(10,1:4), ...
    name(11,1:4), name(12,1:4), name(13,1:4), name(14,1:4), name(15,1:4), ...
    name(16,1:4), name(17,1:4), name(18,1:4), name(19,1:4), name(20,1:4), ...
    name(21,1:4), name(22,1:4), name(23,1:4), name(24,1:4), name(25,1:4), ...
    name(26,1:4), name(27,1:4), name(28,1:4), name(29,1:4), name(30,1:4) } );

  xlabel ( '<-- Sponsorship Dollars -->', 'Fontsize', 16 );
  title ( 'Who makes the big bucks?', 'Fontsize', 16 );
  grid ( 'on' );

  filename = 'basketball_barh.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'basketball_barh\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

