%% sag_plot plots the sag function.
%
a = 0.0;
b = 10.0;
x = linspace ( a, b, 101 );
y = sag ( x );

clf ( );
hold ( 'on' );
plot ( x, y, 'linewidth', 3 );
plot ( [a,b], [0,0], 'k-', 'linewidth', 3 );
%
%  Optionally, mark three points that bracket the minimizer.
%
%x2 = [ 6.0, 6.5, 7.0];
%y2 = sag(x2);
%plot ( x2, y2, 'r.', 'markersize', 40 );
hold ( 'off' );

grid ( 'on' );
xlabel ( '<-- x -->' );
ylabel ( '<-- sag(x) -->' );
title ( 'sag function' );

print ( '-dpng', 'sag.png' );
