correct iteration in plot