x = -2.0:0.05:1.5;
f = exp(x);

p0 = 1+0*x;
p1 = 1+x;
p2 = 1+x+(1/2)*x.^2;
p3 = 1+x+(1/2)*x.^2+(1/6)*x.^3;
p4 = 1+x+(1/2)*x.^2+(1/6)*x.^3+(1/24)*x.^4;


figure(1)
plot(x,p0,x,p1,x,p2,x,p3,x,p4,x,f,'k-.','linewidth',3)
grid
legend('\fontsize{16} p0','\fontsize{16} p1', ...
       '\fontsize{16} p2','\fontsize{16} p3', ...
       '\fontsize{16} p4','\fontsize{16} e^x','Location','NorthWest')
title('\fontsize{16} Taylor polys for e^x')

