How to add text to individual curves on a plot in R?




I want to add some text or labels on different curves on the same plot, How to do it in R?

I want something like this->



The text() function allows us to put text on the plot where we want it. An obvious use is to label a line or group of points.

This would give us two labels in the upper right corner of the plot, which with appropriate arrows could be used in place of a legend. Note that vectors were supplied as the coordinates. The first label would be centered at (2,37), and the second at (2,35), as the default alignment is to center the labels.