Add legend to plot r