Reputation: 8200
I am trying to make subscript in xarrow
, yarrow
and zarrow
title of ggtern
plot as given in its example using the following code
library(ggtern)
data(Feldspar)
ggtern(data=Feldspar,aes(x=Ab,y=An,z=Or)) +
labs( x = "NaAlSi_3O_8",
xarrow = "Albite, NaAlSi_3O_8",
y = "(Na,K)AlSi_3O_8",
yarrow = "Anorthite (Na,K)AlSi_3O_8",
z = "KAlSi_3O_8",
zarrow = "Orthoclase KAlSi_3O_8") +
theme_latex(TRUE) +
geom_point() +
theme_showarrows() +
theme_clockwise()
As it can be seen from the above plot that subscript is not working. So, I have tried to use expression
which worked for x, y, z labs but not for xarrow
, yarrow
and zarrow
ggtern(data=Feldspar,aes(x=Ab,y=An,z=Or)) +
labs( x = expression(NaAlSi[3]~O[8]),
xarrow = expression(paste("Albite,"~NaAlSi[3]~O[8])),
y = expression(paste("(Na,K)"~AlSi[3]~O[8])),
yarrow = expression(paste("Anorthite (Na,K)"~AlSi[3]~O[8])),
z = expression(KAlSi[3]~O[8]),
zarrow = expression(paste("Orthoclase,"~KAlSi[3]~O[8]))) +
theme_latex(TRUE) +
geom_point() +
theme_showarrows() +
theme_clockwise()
How can I make subscript in xarrow
, yarrow
and zarrow
?
Upvotes: 0
Views: 51