%% plot_script plots some random data to a PNG file.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 December 2019
%
%  Author:
%
%    John Burkardt
%
fprintf ( 1, '\n' );
fprintf ( 1, 'plot_script\n' );
fprintf ( 1, '  A MATLAB script to create a plot and save it as a PNG file.\n' );

n = 200;
x = 1 : n;
y = 2 * rand ( 1, n ) - 1;
y = sign ( y ) .* y.^2;
y = cumsum ( y, 2 );
plot ( x, y );

xlabel ( 'X', 'FontName', 'Helvetica', 'FontWeight', 'bold', ...
  'FontSize', 16 );

ylabel ( 'Y', 'FontName', 'Helvetica', 'FontWeight', 'bold', ...
  'FontSize', 16, 'Rotation', 0 );

title ( 'Power\_Plot', 'FontName', 'Helvetica', 'FontWeight', ...
  'bold', 'FontSize', 16 );

filename = 'plot.png';
print ( '-dpng', filename );
fprintf ( 1, '\n' );
fprintf ( 1, '  The data was stored in "%s".\n', filename );
%
%  Terminate.
%
fprintf ( 1, '\n' );
fprintf ( 1, 'table_script\n' );
fprintf ( 1, '  Normal end of execution.\n' );

exit ( );

