function trig_interp_basis_display ( k, filename )

%*****************************************************************************80
%
%% trig_interp_basis_display() displays trigonometric interpolation basis functions.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 July 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer k(*), the indices of the basis vectors.
%
%    string filename: the name of the file to contain the plot.
%
  x = linspace ( -1.0, +1.0, 501 );

  figure ( );

  clf ( );

  hold ( 'on' );

  for i = 1 : length ( k )
    y = trig_interp_basis ( x, k(i) );
    plot ( x, y, 'Linewidth', 2 );    
  end

  grid ( 'on' );
  xlabel ( '<---X--->' );
  ylabel ( '<--Tau(I;X)--->' );
  s = '';
  for i = 1 : length ( k )
    splus = num2str ( k(i) );
    s = [ s; splus ];
  end
  legend ( s );
  title ( 'Trigonometric interpolation basis functions' );

  hold ( 'off' );

  print ( '-dpng', filename );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );

  return
end
