Counting frequency of each x and y coordinates
if ( x_axis . ContainsKey ( p [ i , 0 ] ) ) x_axis [ p [ i , 0 ] ] = x_axis [ p [ i , 0 ] ] + 1 ; else x_axis . Add ( p [ i , 0 ] , 1 ) ; if ( y_axis . ContainsKey ( p [ i , 1 ] ) ) y_axis [ p [ i , 1 ] ] = y_axis [ p [ i , 1 ] ] + 1 ; else y_axis . Add ( p [ i , 1 ] , 1 ) ; }