上标"^ oC";在ggplot的ylab中- [英] Superscript "^oC" in ylab in ggplot -

查看:46
本文介绍了上标"^ oC";在ggplot的ylab中-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图绘制"^ oC",但不断出现错误:错误:" ggplot中出现意外的'^'但是,如果我放置"R ^ {o} C"是可行的.请参阅下面的代码段.第一个代码不起作用,第二个代码不起作用,但是对于ylab中的"R"无效.

Trying to plot "^oC" but keep getting an error: "Error: unexpected '^' in "ggplot" However if I place "R^{o}C" is works. See code snippets below. The first code does not work the second works but not useful with "R" in ylab.

ggplot(MD15,aes(DateTime,Temp/100))+ geom_point(position ="jitter")+ labs(title ="Phase 3-March 2012")+ ylab(expression(Temp〜(〜^ {o}〜C)))

ggplot(MD15,aes(DateTime,Temp/100))+ geom_point(position ="jitter")+ labs(title ="Phase 3-March 2012")+ ylab(expression(Temp〜(R^ {o}〜C)))

环顾四周并尝试了一些建议,但没有任何效果.如果已回答此问题,将不胜感激.谢谢!文斯

Looked around and tried several suggestions but none work. If this has been answered a link would be appreciated. Thanks! Vince

推荐答案

qplot(1,1) + ylab(expression("today's temperature is "*-5~degree*C))

这篇关于上标"^ oC";在ggplot的ylab中-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆