我有一些收入数据,我希望按种族绘制一系列直方图。
白人的收入最高可达61.5万美元,明显高于其他种族。我想将xmax设置为300,000以帮助显示,但ggplot没有响应我的xmax命令。
ggplot(employeeservices, aes(x=employeeservices$INCWAGE))
+ geom_density(xmax=300000) + facet_wrap(~Race2, ncol = 2) 这里有什么特别的指导吗?
发布于 2013-07-03 03:17:32
您需要使用xlim而不是xmax。
ggplot(employeeservices, aes(x=employeeservices$INCWAGE)) +
geom_density() + facet_wrap(~Race2, ncol = 2) + xlim(0,300000)https://stackoverflow.com/questions/17355294
复制相似问题