adding function to plot subsets