Alternate color for each point in scatter plot and add legend

Oh, or group. group is probably what you want.

scatter(x, y, group=repeat('a':'e', 5))

image

4 Likes