【发布时间】:2017-01-28 21:27:11
【问题描述】:
我想更改注释文本的背景颜色,使其变为绿色并覆盖其后面的任何内容(如下例中的水平线)。我该怎么做?
ggplot() +
geom_hline(yintercept=0) +
annotate("text",x=0,y=0,label="Here is a line")
【问题讨论】:
-
你可以使用
annotate("rect",xmin=?,xmax=?, ymin=?, ymax=?, fill="yellow"),你应该在“文本注释”之前使用这一行,但是geom_label更干净
标签: r ggplot2 colors background-color annotate