n-1 plot script