changed the data structure in scatter plot