我有以下數據:GGPLOT2條形圖符號上y軸
mydata <- data.frame(x = c("UK1", "UK2", "UK3", "UK4", "UK5", "UK6", "UK7"),
n = c(50, 55, 58, 64, 14, 18, 45),
F = c(-6, 17, 26, -37, 44, -22, 15),
z = c("a", "a", "b", "a" , "b", "b", "a"))
我想創建列x的針對列n一個ggplot(條形圖)(x軸)(y軸)的顏色按列z分割。棘手的部分是如果F的值是正值,並且負值的話,我希望條形圖能夠繼續上升。這可能與ggplot?
你得到一個豎起大拇指提供一個數據框。但是你的問題涉及'z'和'Z';後者應該是'F'來對應數據框中的那個? – MrGumble