在ggplot中注释大于或等于 [英] Annotate with greater than or equal to in ggplot

查看:156
本文介绍了在ggplot中注释大于或等于的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用一句大鱼≥45厘米来标注ggplot,但似乎无法实现它。
我尝试了下面的例子,但它产生了一个=。

I want to annotate a ggplot with the phrase "Large fish ≥ 45cm" but can't seem to achieve it. I tried the following example but it produces an "=". Also adding "45" throws up an error.

ggplot(mtcars, aes(mpg, disp))+
geom_point()+
annotate("text",25,400, label=("Fish*~symbol('\u2265')*~cm"), parse=TRUE, hjust=0) 


推荐答案



How about this:

ggplot(mtcars, aes(mpg, disp))+
    geom_point()+
    annotate("text",25,400, label=("'Large fish' >= 45 ~ 'cm'"), parse=TRUE, hjust=0)

这篇关于在ggplot中注释大于或等于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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