Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

TeX

Render TeX in a plotly graph using MathJax


Description

This function makes it slightly easier to render TeX in a plotly graph – it ensures that MathJax is included with the final result and also ensures the provided string is surrounded with $ (this is what plotly.js uses to declare a string as TeX).

Usage

TeX(x)

Arguments

x

a character vector

See Also

Examples

plot_ly(x = c(1, 2, 3, 4), y = c(1, 4, 9, 16)) %>%
  layout(title = TeX("\\text{Some mathjax: }\\alpha+\\beta x")) %>%
  config(mathjax = "cdn")

plotly

Create Interactive Web Graphics via 'plotly.js'

v4.10.0
MIT + file LICENSE
Authors
Carson Sievert [aut, cre] (<https://orcid.org/0000-0002-4958-2844>), Chris Parmer [aut], Toby Hocking [aut], Scott Chamberlain [aut], Karthik Ram [aut], Marianne Corvellec [aut] (<https://orcid.org/0000-0002-1994-3581>), Pedro Despouy [aut], Salim Brüggemann [ctb] (<https://orcid.org/0000-0002-5329-5987>), Plotly Technologies Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.