I am trying to put a text label in ggplot, but I do not want to specify the label coordinates in the data coordinates, but use some coordinates that are not related to the data. I know the transformation trick:
xrng <- range(x)
yrng <- range(y)
plot <- plot + annotate("text",x = xrng[2], y = yrng[2], label="bla")
But this does not work well for graphs with a logarithmic scale (and you need to do the conversion, which is not always as simple as in the example). Any ideas?
source
share