updated Min_Thresh function to compile data and output polt with ggplot