added PlotHandler to handle both histograms and scatter plots