What I'm missing here? Not getting proper legend label.
p <- ggplot(mtcars, aes(factor(cyl), mpg))+ geom_boxplot(aes(fill = cyl))
p <- p + labs(fill=expression(paste("Temperature\n (", degree ~ F, " )")))
p
I do not see any need to use plotmath-paste:
p <- ggplot(mtcars, aes(factor(cyl), mpg))+ geom_boxplot(aes(fill = cyl))
p <- p + labs(fill=expression(atop("Temperature", ( degree~F))))
p
Plus the help(plotmath) page makes clear that "\\n" does not play well with expressions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.