Latex and variables in plot label in R?

前端 未结 4 1201
盖世英雄少女心
盖世英雄少女心 2021-02-15 04:20

How do I use variables in Latex expressions in R?

For example:

plot(X, Y, main=expression(R^2))

Will put R with a nice superscripted 2

4条回答
  •  时光取名叫无心
    2021-02-15 04:58

    tikz and psfrag allow you to use actual LaTeX code and output instead of plotmath's, resulting in better typographic consistency.

    See this question for details. Getting LaTeX into R Plots

提交回复
热议问题