Converts a LaTeX string to a plotmath expression.
Converts a LaTeX string to a plotmath expression.
TeX(
string,
bold = FALSE,
italic = FALSE,
output = c("expression", "character", "ast")
)string |
A character vector containing LaTeX expressions. Note that any backslashes must be escaped (e.g. "$\alpha"). |
bold |
Whether to make the entire label bold |
italic |
Whether to make the entire label italic |
output |
The returned object, one of "expression" (default, returns a plotmath expression ready for plotting), "character" (returns the expression as a string), and "ast" (returns the tree used to generate the expression). |
Returns an expression (see the output parameter).
TeX("$\\alpha$")
TeX("The ratio of 1 and 2 is $\\frac{1}{2}$")
a <- 1:100
plot(a, a^2, xlab=TeX("$\\alpha$"), ylab=TeX("$\\alpha^2$"))Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.