Kashif Ali
Kashif Ali

Reputation: 197

How to write an asterisk (*) symbol in superscript of a Greek letter in ggplot2?

With reference to following figure, I want to write Δ* instead of Δ in the Xlab. I am using following line in my R code.

g=ggplot(SS4, aes(x = Delta, y = SRE, group = Estimators, colour = Estimators)) + geom_line(size=1.1)+xlab(expression(Delta))+ theme(legend.position="none",axis.text=element_text(size=12))
direct.label(g, list(first.points, hjust = 1.1,vjust = 1)).

enter image description here

How should I modify xlab(expression(Delta)), so that I am able to write Δ*? I have tried xlab(expression(Delta^{*})), but its not working.

Upvotes: 0

Views: 2988

Answers (1)

uhlitz
uhlitz

Reputation: 1522

Use paste() within expression()

xlab(expression(paste(Delta, "*")))

Upvotes: 1

Related Questions