python code for histogram plots