function spy(M) //traduction d'une fonction de Matlab

[p,q]=size(M);
[l0,c0]=find(M==0); [l1,c1]=find(M~=0); square(1,1,p,q); r=[0 0 p q]+.5;
plot2d(c0,q+1-l0,0,"032",rect=r), plot2d(c1,q+1-l1,-4,"032",rect=r)

//Variante inspirée du livre d'Allaire et Kaber
//[p,q]=size(M);
//x=(1:p)'*ones(1,q); x=x(:)'; x=[x-.4;x+.4;x+.4;x-.4];
//y=ones(p,1)*(1:q);  y=y(:)'; y=[y+.4;y+.4;y-.4;y-.4];
//plot3d(x,y,list(zeros(4,p*q),8-7*bool2s(M)),theta=0,alpha=0,flag=[2,6,0])

endfunction