added plot_data flag