Improve code quality and fix python3 plot bug

For the ap_colors numpy array used in the plot we now use a 'U4' dtype
instead of 'S4'. This make it compatible with both python2 and python3
at the same time.