distribution.asy (690B)
1 real gauss(real x, real mu, real sigma){ 2 return 1/(sqrt(2*pi)*sigma)*exp(-((x-mu)/(1.41*sigma))**2); 3 } 4 5 real on_gauss(real x){ 6 return gauss(x, 300, 200); 7 } 8 real off_gauss(real x){ 9 return gauss(x, 1300, 200); 10 } 11 import graph; 12 size(10cm,5cm,IgnoreAspect); 13 draw(graph(on_gauss, -500,2000, operator ..), green); 14 draw(graph(off_gauss, -500,2000, operator ..), red); 15 xaxis("$\Delta t$",BottomTop,LeftTicks); 16 yaxis("$P$",LeftRight,RightTicks(trailingzero)); 17 draw((300,on_gauss(300)) -- (300,0), dashed+green); 18 draw((1300,off_gauss(1300)) -- (1300,0), dashed+red); 19 label("ON", (300,0), S,green); 20 label("OFF", (1300,0), S,red); 21 draw((800, max(currentpicture,true).y) -- (800,0), scale(1.5)*blue);