JACKY88
JACKY88

Reputation: 3557

Plot text subscript with comma between two values

I want to write the following text when I plot something in R. Here the subscript is Greek letters alpha and nu with a comma in between.

enter image description here

I tried the following code but didn't get comma and nu.

plot(1, 1, main = expression(t[alpha, nu]))

enter image description here

Any suggestions?

Upvotes: 5

Views: 2465

Answers (2)

akrun
akrun

Reputation: 887701

We can also use bquote

plot(1, 1, main = bquote(t[alpha*","*nu]))

enter image description here

Or as @Roland mentioned, quote would also work

plot(1, 1, main = quote(t[alpha*","*nu]))

Upvotes: 5

Rich Scriven
Rich Scriven

Reputation: 99361

You could use paste() to include the comma:

plot(1, 1, main = expression(t[paste(alpha, ",", nu)]))

giving

enter image description here

Upvotes: 5

Related Questions