function coins_barchart ( n, v, label, filename )

%*****************************************************************************80
%
%% coins_barchart() makes a bar chart of N coin tosses.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 February 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of tosses.
%
%    real V(N), the toss results, -1 or +1.
%
%    string LABEL, a label for the plot.
%
%    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, '  Graphics saved as "%s"\n', filename );

  return
end
