gnuplot で周期関数を描く

周期を {T} として {f\left(\frac{2}{\pi}\arctan\left(\tan\frac{\pi x}{T}\right)\right)} とすればよい.

gnuplot> T = 2
gnuplot> plot [-2:2] (2/pi)*atan(tan(pi*x/T)) title "f(x)"
gnuplot> replot ((2/pi)*atan(tan(pi*x/T)))**2 title "g(x)"