Skip to Content

putting text next to a plot in R

I have a plot with many "lines" in it (using points with type being l).

I would like to put a small piece of text next to them. I could do that all sort of ways, such as using mtext, but the problem is that there are many plots to be generated automatically, and there could be many lines in a single plot, so I would like the text to be placed automatically close to the line in an empty spot...

Is there a way to do that?