I want to know the coordinates for the bounding box (top left, top right, bottom left, and bottom right coordinates) for the text "ABC" as shown in the screenshot:
My code is:
d <- data.frame(x = 0, y = 0, text = "ABCDEFGHIJKLM")
library(ggplot2)
ggplot(d, aes(x = x, y = y, label = text)) + geom_text()
In this example, the coordinate of the bottom of the text (this is what I am looking for) is: x = 0.0125, y = 0.002 .
I appreciate any solution/suggestion. Thanks.