creating separate plotting function
creating separate plotting function