generate p-r curve