I'm recently trying to make some nice interactive plots using iplots and qtlcharts, but didn't manage to find a feasible solution to add labels or legends on it. Anyone knows how to add text to an interactive plot in R?
Below are some codes for testing.
library(qtlcharts)
x <- rnorm(100)
grp <- sample(1:3, 100, replace=TRUE)
y <- x*grp + rnorm(100)
iplot(x, y, grp)
Is there some function like: plot(x, y); text(0,0, labels = "test") for adding text to interactive plot?
edit: Thanks Rafael and TheBiro for the answers. Basically, I wanted to add a permanent text (and maybe lines as well) in the interactive plot like what we achieve using text() in normal plots. Correspondent code in normal plot:
plot(x, y); text(-2,0, labels = "test");abline(h=-1)
Is it possible?