add plot.flag for return "plot" for TRUE/"data for plot" for FALSE