added option to choose stat to plot