adding legend to 2d scatter plot