added functionality to plot averaged residuals vs frequency and orbital
phase.