[英]lines to connect geom_jitter points in ggplot2
我正在嘗試連接geom_jitter()
的點。
df<-data.frame(x = c(1, 1, 2, 2, 3, 3),
y = c(1, 1, 2 , 3, 6, 5),
z = c("A", "B", "A", "B", "A", "B"))
ggplot(df, aes(x = x, y = y, col = z)) +
geom_jitter() +
geom_line()
現在線和點沒有連接。
將抖動(一些偏差)添加到您的數據中,然后繪制有偏差的數據。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.