python code for plotting histogram