showing utf-8 character in chart generated by ggplot2

北战南征 提交于 2019-12-24 13:24:01

问题


I want to use the symbol (u+2265):

in the y-axis label of my chart. How can I do that? Thanks.

UPDATE 01

I need to use add a >=95 in the y-axis label, showing the group of people aged more than 95, I tried expression(>=95) but fail as it seems to expect something before >=. What can I do?


回答1:


qplot(1, 1, ylab=expression(phantom(.) >= 95))

By using phantom in the expression, you don't get anything printed. I put a period in there because phantom still leaves space, so I wanted something small.




回答2:


In the y-axis or label?

plot(1,1, ylab = expression(X >= 5))

Try ?expression and ?plotmath.



来源:https://stackoverflow.com/questions/7508754/showing-utf-8-character-in-chart-generated-by-ggplot2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!