全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
501 0
2023-08-05
Often you want to label existing points on the plot. You don’t want the
text to overlap with the points (or bars etc), so it’s useful to offset the text
a little. The nudge x and nudge y parameters allow you to nudge the text a
little horizontally or vertically:
df <- data.frame(trt = c("a", "b", "c"), resp = c(1.2, 3.4, 2.5))
ggplot(df, aes(resp, trt)) +
geom_point() +
geom_text(aes(label = paste0("(", resp, ")")), nudge_y = -0.25) +
xlim(1, 3.6)

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群