我已經腳本下面的例子來說明我的問題。 我想爲每個geom_hline我的情節我自己的自定義圖例和顏色方案。我可以通過使用這個答案來實現這個Construct a manual legend for a complicated plot。 不過,我創建將在一個循環的情節創建任意數量的水平線的功能。這意味着我需要動態地將變量提供給aes_string函數。但是, aes_string(yinterce
這是一個增量的問題直接涉及到這個話題: How do I loop through column names and make a ggplot scatteplot for each one 我想通過列名循環和作,ggplot scatteplot每一個,但我想添加一個水平線,其攔截取決於列中的值。 所以我把代碼: Y <- rnorm(100)
df <- data.frame(A = rn