clear all;
close all;
clc;

x=0:pi/200:pi;
y=sin(x);

y1=x;
y3=y1-x.^3/prod(1:3);
y5=y3+x.^5/prod(1:5);
y7=y5-x.^7/prod(1:7);

plot(x',[y' y1' y3' y5' y7'],'LineWidth',3);
set(gca,'XTick',0:pi/4:pi)
set(gca,'XTickLabel',{'0','pi/4','pi/2','3*pi/4','pi'})
xlabel('0 \leq \theta \leq \pi','FontSize',16)
ylabel('sin(\theta)','FontSize',16)
axis([0,pi,-0.4,1.2])
legend('sin(\theta)','\theta','\theta-\theta^3/3!','\theta-\theta^3/3!+\theta^5/5!','\theta-\theta^3/3!+\theta^5/5!-\theta^7/7!')
