Macro for plotting histograms