Add option to cal residual plot
Merge branch 'devel' into devel2