add legend to the plot