help with TeX expression for plot

Hi folks, I'm having trouble getting a little latex expression to display correctly in a base R plot. I want V\bar_N, which is to say \bar{V}_{N}. When I do

plot(1,1,main = TeX("V\\bar_N"))
I get
image

for the title. I can't figure out how to get the bar and what I'm doing also kills the subscript.

Any help from R/LaTeX gurus much appreciated.

Hi @startz

plot(1,1,main = expression(bar(V)[N]))

More info at R: Mathematical Annotation in R .

1 Like

If you want to use TeX(), then the expression should be within $$.
Hence TeX("$\\bar{V}_N$") will do the job.
The advantage is that you can plug in tex-expressions directly.
In most occasions this works fine.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.