getf("freq2d.sci")
//
// Lois uniformes
//
u=rand(2,2000);
xset("window",0); xbasc(); 
plot2d(u(1,:),u(2,:),0)
bx=[0:0.2:1]; by=bx;
f=freq2d(u,bx,by);
xbasc()
hist3d(list(f,bx,by))
//
// Lois triangulaires
//
t1=max(rand(2,2000),"r");
t2=min(rand(2,2000),"r");
xset("window",1); xbasc();
plot2d(t1,t2,0);
bx=[0:0.2:1]; by=bx;
f=freq2d([t1;t2],bx,by);
xbasc()
hist3d(list(f,bx,by))
//
// Echantillon gaussien
//
M=[0;0]; S=[1,0.8;0.8,1];
v=grand(2000,"mn",M,S);
xset("window",2); xbasc()
plot2d(v(1,:),v(2,:),0)
bx=[-3:1:3]; by=bx;
f=freq2d(v,bx,by);
xbasc()
hist3d(list(f,bx,by))
