Bex Bex - 1 year ago 179
LaTeX Question

Adding maths function in ggplot annotation

I have a density plot using ggplot and I have a mathematical function I want to add on the graph using +annotate() or something similar, but I am not sure how to do this.

The symbol I want in latex code is:


Thanks for any help :)

Answer Source

try this,

# install.packages("latex2exp")

test <- TeX("$f_{\\epsilon}(|R_{i}|)$")

grid.text(test, gp = gpar(cex=4))

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download