Reputation: 663
I would like to get this string Linear Prediction of Protein (mg/ gm^-1 per kg)
in my ggplot y axis. I tried the below syntax, but could not get as desired. What am I missing here?
p + ylab(bquote('Linear Prediction of Protein\n (mg/' ~gm^-1 'per kg soil'))
Upvotes: 0
Views: 253
Reputation: 2050
Here is a version you could use to split the lines of text
+ ylab(expression(atop("Linear Prediction of Protein", paste("(mg/g", m^-1, ") per kg soil"))))
Upvotes: 1