in reply to Problems processing data for graph

I wrote a brief description on how to do this problem here. The error you are getting is probably because some of your bins are not initialized. Put this in your code before the print statement:

$binarray[ $i ][ $j ] ||= 0;

the lowliest monk