add legend to plot