function plot_mono ( r_shape, p_shapes, sol_file, image_file, solver)

%****************************************************************************80
%
%% PLOT_MONO plots monohedral tilings after optimization.
%
%  Discussion:
%
%  This program just combines the codes POLYOMINO_MONOHEDRAL_TILING_PLOT
%  and CPLEX_SOLUTION_READ (or SCIP_SOLUTION_READ or GUROBI_SOLUTION_READ)
%  into one program. Do the following steps:
%
%  1, Run the appropriate 'LP_MAKE' file in MATLAB
%  2. Take the resulting .LP file and solve with an optimizer
%  3. Bring the solution from 2. back into MATLAB and run this
%      program
%  4. Wait for all the image files to be generated
%
%  Modified:
%
%    10 July 2018
%
%  Author:
%
%    John Burkardt, Marcus Garvie
%
%   Parameters:
%   See POLYOMINO_MONOHEDRAL_TILING_PLOT and CPLEX_SOLUTION_READ
%   / SCIP_SOLUTION_READ / GUROBI_SOLUTION_READ
%
%   SOL_FILE is the solution produced by the optimizer we read
%   (extension .sol for CPLEX and GUROBI and extension .txt for SCIP)
%
%   IMAGE_FILE is the name of the image file generated, e.g. 'test01.png'
%   (all valid Matlab extensions allowed, e.g., .jpg, .png, .pdf, .tif,
%   .fig, etc.).  Upto 99 images with automatically incremented numeric labels 
%   are generated and saved,  depending on how many solutions there are, 
%   e.g. test01.png, test02.png, test03.pmg, etc.
%
%   Choose one of the following:
%   SOLVER = 1 for CPLEX 
%   SOLVER = 2 for SCIP
%   SOLVER = 3 for GUROBI

%
% Read the LP file
%
  if solver == 1
      x = cplex_solution_read ( sol_file );  % CPLEX
  elseif solver == 2
      x = scip_solution_read ( sol_file );  % SCIP
  else  % (solver = 3)
      x = gurobi_solution_read ( sol_file );  % GUROBI
  end
 
 % 
 % Plot the solution(s)
 %
  polyomino_monohedral_tiling_plot ( r_shape, p_shapes, x, image_file, '' );

  return
end
