你需要 stack() 你的数据首先,可能就是你所“看到的”。
stack()
dt <- setNames(stack(dt), c("value", "Salary")) library(ggplot2) ggplot(dt, aes(x=Salary, y=value)) + geom_point() + facet_grid(.~Salary)
的 产量 强>