function price_subplots ( )

%*****************************************************************************80
%
%% price_subplots() reads price data and makes 6 subplots.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 March 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'price_subplots():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s:\n', version ( ) );
  fprintf ( 1, '  Make 6 subplots of price data over time.\n' );
%
%  Read the (241) items of data.
%
  data = csvread ( 'price_data.csv', 2 );
  label = { ...
    'Month', 'Year', 'Bananas', 'Oranges', 'Bread', ...
    'Tomatoes', 'Chicken', 'Electricity', 'Eggs', 'Gasoline', ...
    'Beef', 'Heating gas', 'Milk' };
%
%  Create a vector X, simply counting from 1 to 241.
%
  data_num = size ( data, 1 );

  x = linspace ( 1, data_num, data_num );
%
%  Create 6 plots:
%
%  (1,1)  (1,2)  (1,3)
%  (2,1)  (2,2)  (2,3)
%
  m = 2;
  n = 3;
  k = 2;
  p = 0;
  for i = 1 : m
    for j = 1 : n
      p = p + 1;
      subplot ( m, n, p );
      k = k + 1;
      plot ( x, data(:,k) );
      grid ( 'on' );
      title ( label{k} );
      xlabel ( 'Month Index' );
      ylabel ( 'Price in Dollars' );
    end
  end
%
%  Save the graphics in a file.
%
  filename = 'price_subplots.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'price_subplots():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

