Counting frequency of each x and y coordinates
if ( x_axis . has ( p [ i ] [ 0 ] ) ) x_axis . set ( p [ i ] [ 0 ] , x_axis . get ( p [ i ] [ 0 ] ) + 1 ) else x_axis . set ( p [ i ] [ 0 ] , 1 ) if ( y_axis . has ( p [ i ] [ 1 ] ) ) y_axis . set ( p [ i ] [ 1 ] , y_axis . get ( p [ i ] [ 1 ] ) + 1 ) else y_axis . set ( p [ i ] [ 1 ] , 1 ) }