corrected plotting function

plotting function broke with dplyr, fixed