我想在mtcars数据集的直方图上创建一个时间戳,我正在绘制里程频率。
library(ggplot2)
ggplot(mtcars, aes(x=mpg, fill="red")) + geom_histogram(bins = 30) +
geom_vline(aes(xintercept=mean(mpg)),color="blue", linetype="dashed",
size=1) +theme(legend.position="top")
答案 0 :(得分:0)
喜欢这个吗?
ggplot(mtcars, aes(x=mpg, fill="red")) + geom_histogram(bins = 30) +
geom_vline(aes(xintercept=mean(mpg)),color="blue", linetype="dashed",
size=1) +theme(legend.position="top") +
annotate("text", x = 30, y = 4, label = Sys.time())