# set terminal svg size 600,400 dynamic enhanced fname 'arial' fsize 10 mousing name "piecewise_2" butt dashed dashlength 1.0 # set output 'piecewise.2.svg' set format x "%.1f" set format y "%.1f" set format x2 "%.1f" set format y2 "%.1f" set format z "%.1f" set format cb "%.1f" set format r "%.1f" set key inside left top vertical Left reverse enhanced autotitles nobox set key invert samplen 4 spacing 1 width 0 height 0 set label 1 "plot norm(x), [0:1] part1(x), [1:4] part2(x)" at 1, 0.62, 0 left norotate back nopoint offset character 0, 0, 0 set arrow 1 from 1, 0.7, 0 to 1, 0.9, 0 nohead back nofilled linetype -1 linewidth 1.000 set style line 1 linetype 0 linewidth 3.000 pointtype 0 pointsize default pointinterval 0 set style line 2 linetype 0 linecolor rgb "red" linewidth 3.000 pointtype 0 pointsize default pointinterval 0 set style data lines set xtics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 autojustify set title "Piecewise approximation to the\nNormal Cumulative Distribution Function" set xrange [ 0.00000 : 4.00000 ] noreverse nowriteback set yrange [ 0.500000 : 1.10000 ] noreverse nowriteback part1(x) = 0.5 + (9.*x-x**3)/ 24. part2(x) = 1.0 + (x-3.0)**3 / 48. save_encoding = "utf8" GPFUN_part1 = "part1(x) = 0.5 + (9.*x-x**3)/ 24." GPFUN_part2 = "part2(x) = 1.0 + (x-3.0)**3 / 48." part1 = "part1: for x < 1 norm(x) ≈ ½ + (9x-x^3) / 24" part2 = "part2: for x > 1 norm(x) ≈ 1 + (x-3)^3 / 48" plot norm(x) lt -1, [1:4] part2(x) ls 2 title part2, [0:1] part1(x) ls 1 title part1