function box_fill ( m, i, j, color, label1, label2 )

%*****************************************************************************80
%
%% box_fill() plots a filled unit square centered at matrix position (I,J)
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the number of rows in the matrix.
%
%    integer I, J, the matrix indices of the box.
%
%    color COLOR, can be any of the 8 abbreviated color terms
%    'r', 'g', 'b', 'c', 'm', 'y', 'w', 'k', or an RGB triple such as 
%    [1.0,0.4,0.0].  The box is filled with this color.
%
%    character vector LABEL1: a short label, usually the state abbreviation.
%
%    character vector LABEL2: a short label to print below the first.
%
  xc = j - 0.5;
  yc = m - i + 0.5;

  r = 0.45;

  a = xc - r;
  b = xc + r;
  c = yc - r;
  d = yc + r;

  fill ( [ a, b, b, a ], [ c, c, d, d ], color, 'edgecolor', 'none' );
%
%  Place the texts.
%
  t1 = text ( xc, yc, label1 );
  set ( t1, 'HorizontalAlignment', 'center' );

  t2 = text ( xc, yc-0.25, label2 );
  set ( t2, 'HorizontalAlignment', 'center' );

  return
end

