function coin_barchart ( n, v, label, filename )

%*****************************************************************************80
%
%% COIN_BARCHART makes a bar chart of N coin tosses.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    22 February 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the number of tosses.
%
%    Input, real V(N), the toss results, -1 or +1.
%
%    Input, string LABEL, a label for the plot.
%
%    Input, string FILENAME, a name for the plot file.
%
  clf;
  histogram ( v );

  grid on
  title ( label );
  limits = axis;
  limits(3) = 0;
  limits(4) = n;
  axis ( limits );
  set ( gca, 'xtick', [] );

  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Saving a copy of this plot in "%s"\n', filename );

  return
end
