function gl_grid_square_display ( order_1d )

%*****************************************************************************80
%
%% gl_grid_square_display() displays a 2D square Gauss-Legendre grid.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 November 2006
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer ORDER_1D: the order to use in X and Y.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gl_grid_square_display():\n' );
  fprintf ( 1, '  Display a 2D square Gauss-Legendre grid.\n' );

  dim_num = 2;
     
  clf ( );

  order_nd = order_1d^dim_num;
    
  points = gl_grid_square ( 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, order_1d );
  title ( s );

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

  return
end
