I am developing a graphic with ggplot2 wherein I need to superimpose text over other graphical elements. Depending on the color of the elements underlying the text, it can b
In the development version of ggplot2 package there is a new geom called geom_label()
that implements this directly. Transperency can be atchieved with alpha=
parameter.
ggplot(data = SampleFrame,
aes(x = X, y = Y)) + geom_point(size = 20)+
geom_label(data = TextFrame,
aes(x = X, y = Y, label = LAB),alpha=0.5)