n = 15;

x = linspace ( -2.0, +2.0, n );
y = ( x + 1.0 ) .* ( x - 0.5 );
figure ( 1 )
plot ( x, y, 'r.-', 'LineWidth', 2, 'MarkerSize', 35 );
grid on
xlabel ( '<--- X --->', 'FontSize', 16 );
ylabel ( '<--- Y(X) --->', 'FontSize', 16 );
title ( 'Y = (X+1)*(X-0.5) (ordered)', 'FontSize', 24 );
filename = 'parabola_ordered.png';
print ( '-dpng', filename );
fprintf ( 1, '\n' );
fprintf ( 1, '  Graphics file saved as "%s"\n', filename );
%
x = linspace ( -2.0, +2.0, n );
i = randperm ( n );
x = x(i);
y = ( x + 1.0 ) .* ( x - 0.5 );
figure ( 2 )
plot ( x, y, 'r.-', 'LineWidth', 2, 'MarkerSize', 35 );
grid on
xlabel ( '<--- X --->', 'FontSize', 16 );
ylabel ( '<--- Y(X) --->', 'FontSize', 16 );
title ( 'Y = (X+1)*(X-0.5) (random)', 'FontSize', 24 );
filename = 'parabola_random.png';
print ( '-dpng', filename );
fprintf ( 1, '\n' );
fprintf ( 1, '  Graphics file saved as "%s"\n', filename );
