Quantcast
Channel: Subscript letters in ggplot axis label - Stack Overflow
Browsing index pages (3 articles)

Subscript letters in ggplot axis label

I'm trying to work out how to have subscript letters in an axis label. dat <- data.frame(x = rnorm(100), y = rnorm(100))ggplot(dat, aes(x=x,y=y)) + geom_point() + labs(y=expression(Blah[1]))dat...

View Article


Answer by nzcoops for Subscript letters in ggplot axis label

Okay. I swear I didn't post this just to answer it myself, despite how quickly I got it (always the way when you ask a question!)Here it is:ggplot(dat, aes(x=x,y=y)) + geom_point() +...

View Article


Answer by IRTFM for Subscript letters in ggplot axis label

The reason the last one fails is that the arguments to expression get run through the R parser and an error is returned when they fail the test of whether they could possibly be correct R syntax. The...

View Article
Browsing index pages (3 articles)


Latest Images