Function to plot the given data