epsilon=0.4;
xmin=-1-epsilon;
xmax=2+epsilon;
ymin=-2.5;
ymax=2.5;

Setwindow([xmin,xmax], [ymin,ymax]);

function f=f(x,n);  //第n項までのlog(1+x)のTaylor展開
  f=0;
  for i=1:n
    f=f+(-1)^(i+1)*x^i/i;
  end
endfunction

curve=Paramplot('[x, log(1+x)]', 'x=[-0.98,4]', 'N=300');

C=list();
N=5;
for i=1:N
  C($+1)=Paramplot('[t, f(t,i)]', 't=[xmin,xmax]', 'N=300');
end

T=Listplot([1,ymax], [-1,ymax], [-1,ymin], [1,ymin], [1,ymax]);
L1=Listplot([-1,ymax], [-1,ymin]);
L2=Listplot([1,ymax], [1,ymin]);

//Windisp(curve, C, T);

Openfile('tex/color_sample.tex');
Beginpicture('1.5cm');
Setax(6,'O', 'nw');

Setcolor('orange', 1);
Shade(T, 0.08);

Setcolor('black', 1);
Dashline(L1, 0.5);
Drwline(L2, 1);

for i=1:N
  Setcolor([0,0.96,0.39,0], 0.1+(1-0.1)/(N+1)*i);  //wildstrawberry
  Drwline(C(i), 1.4);
end
Setcolor('black', 1);
Drwline(curve, 1);

Expr([2.2,log(2)], 'c', 'y=\log (1+x)');
Expr([1,0], 'ne', '1');
Expr([-1,0], 'nw', '-1');

Letter([xmax,f(xmax,1)], 'e', '\textcircled{\footnotesize 1}');
Letter([xmax,f(xmax,2)], 'e', '\textcircled{\footnotesize 2}');
Letter([1.95,f(1.95,3)], 'n', '\textcircled{\footnotesize 3}');
Letter([2.2,f(2.2,4)], 'e', '\textcircled{\footnotesize 4}');
Letter([1.675,f(1.675,5)], 'n', '\textcircled{\footnotesize 5}');
Letter([2.4,-1.4], 'c',..
 '\ovalbox{\textcircled{\footnotesize n} :..
    $\displaystyle y=\sum_{k=1}^n \frac{(-1)^{k+1}}{k}x^k$}');

Endpicture(1);
Closefile();



