function lm_polynomial_plot ( a, b, index, index2, filename )

%*****************************************************************************80
%
%% lm_polynomial_plot() plots Laguerre polynomials Lm(n,m,x).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 March 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A, B, the plotting range.
%
%    integer INDEX(*), the orders of 1 or more Laguerre polynomials
%    to be plotted together.
%
%    integer INDEX2(*), the second "M" index of the Laguerre polynomials.
%
%    string FILENAME, the name into which the graphics information is
%    to be stored.  Note that the PNG format will be used.
%
  mm = 501;
  x = linspace ( a, b, mm );
  x = x';
  index_num = length ( index );

  clf ( );
  hold ( 'on' );
  for i = 1 : index_num
    n = index(i);
    m = index2(i);
    y = lm_polynomial ( mm, n, m, x );
    plot ( x, y(:,n+1), 'LineWidth', 2 );
  end
  grid ( 'on' );
  xlabel ( '<--- X --->' );
  ylabel ( '<---Lm(n,m,x) --->' );
  title ( 'Laguerre Polynomials Lm(n,m,x)' );
  hold ( 'off' )
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
