Separate plotting function