fixed loop index for curve plots