Corrected error in plot data generation