Displaying a greater than or equal sign

前端 未结 4 1509
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 06:11

I have a plot which is generated thus:

ggplot(dt.2, aes(x=AgeGroup, y=Prevalence)) + 
    geom_errorbar(aes(ymin=lower, ymax=upper), colour=\"black\", width=         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 07:04

    You can pass an expression (including phantom(...) to fake a leading >= within the label argument to scale_x_discrete(...)

    for example

     .d <- data.frame(a = letters[1:6], y = 1:6)
    
     ggplot(.d, aes(x=a,y=y)) + geom_point() + 
        scale_x_discrete(labels = c(letters[1:5], expression(phantom(x) >=80))
    

    enter image description here

    See ?plotmath for more details on creating mathematical expressions and this related SO question and answer

提交回复
热议问题