x = linspace ( 0.0, 42.0, 101 );
y1 = cos ( x );
y2 = cos_taylor ( x );

clf ( );
hold ( 'on' );
plot ( x, y1, 'b', 'linewidth', 8 );
plot ( x, y2, 'r', 'linewidth', 3 );
hold ( 'off' );
title ( 'Cos(x) approximated by power series', 'fontsize', 16 )
grid ( 'on' );

filename = 'cos_taylor_test.png';
print ( '-dpng', filename );
fprintf ( 1, '  Graphics saved as "%s"\n', filename );

