Add option to cal residual plot