Loop and plot histograms