Corrected resampling segments on plot 4