function gl_grid_display ( x_order, y_order )

%*****************************************************************************80
%
%% gl_grid_display() displays a 2D Gauss-Legendre grid.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 November 2006
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer X_ORDER, Y_ORDER: the orders of the X and Y grids.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gl_grid_display():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Display a 2D Gauss-Legendre grid.\n' );

  dim_num = 2;
 
  order_1d = [ x_order, y_order ];
 
  clf ( );

  order_nd = prod ( order_1d(1:2) );
    
  points = gl_grid ( dim_num, order_1d, order_nd );
%
%  We have to name the axes in order to control the grid.
%
  axes_handle = axes;
%
%  Plot the points.
%
  handle = scatter ( points(1,:), points(2,:), 'filled' );
%
%  Force the plotting region to be square, not rectangular.
%
  axis ( 'square' );
%
%  Request grid lines.
%
  grid ( 'on' );
%
%  Specify the location of the grid lines, and suppress labeling.
%
  set ( axes_handle, 'xtick', [ -1, -.75, -.5, -.25, 0, .25, .50, .75, 1] );
  set ( axes_handle, 'xticklabel', [] );
  set ( axes_handle, 'ytick', [ -1, -.75, -.5, -.25, 0, .25, .50, .75, 1] );
  set ( axes_handle, 'yticklabel', [] );
%
%  Make the plotting region slightly bigger than the data.
%
  axis ( [ -1.1, 1.1, -1.1, 1.1 ] );
%
%  Title
%
  s = sprintf ( '%dx%d Gauss-Legendre Grid', order_1d(1), order_1d(2) );
  title ( s );

  filename = sprintf ( 'gl_grid_%dx%d.png', x_order, y_order );
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gl_grid_display():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

