Simplified plotting routine for averageLine and averageSmoothLine

Avoid multiple reinitialization.