小编MY.*_*.BK的帖子

在geom_line上显示数据值

我使用ggplot和创建了一个图,geom_line并希望在图上显示各个数据值(数字)。

到目前为止,这是我的代码:

ggplot(errors_prob_3) +

geom_point(aes(x = ID, y = train_mean, colour = 'red')) +
geom_line(aes(x = ID, y = train_mean, colour = 'red')) +

geom_point(aes(x = ID, y = train_sd, colour = 'blue')) +
geom_line(aes(x = ID, y = train_sd, colour = 'blue')) +

geom_point(aes(x = ID, y = test_mean, colour = 'green')) +
geom_line(aes(x = ID, y = test_mean, colour = 'green')) +

geom_point(aes(x = ID, y = test_sd, colour = 'purple') )+
geom_line(aes(x = …
Run Code Online (Sandbox Code Playgroud)

r ggplot2 geom-text

-1
推荐指数
1
解决办法
1934
查看次数

标签 统计

geom-text ×1

ggplot2 ×1

r ×1