Completed plot regression function.