Add less than symbol, “<”, to a ggplot via geom_text in R

后端 未结 1 1819
花落未央
花落未央 2021-02-11 01:59

The short version: How would I make this contrived code plot a proper greek beta character AND the rest of the label string, with the space and the less than ch

相关标签:
1条回答
  • 2021-02-11 02:48

    This should do it:

    g <- ggplot(data=df, aes(x=a,y=b)) + geom_point()
    g + annotate("text", x=5,y=4,parse=TRUE, label="beta==1.00 * ' p<0.0001'")
    

    It's a matter of splitting the label with single quotes to the side of the whitespace and connecting two label bits with *. You also need the == for equals to.

    enter image description here

    0 讨论(0)
提交回复
热议问题