【发布时间】:2011-04-06 02:56:03
【问题描述】:
我绘制了以下内容:
library(ggplot2)
carrots <- data.frame(length = rnorm(500000, 10000, 10000))
cukes <- data.frame(length = rnorm(50000, 10000, 20000))
carrots$veg <- 'carrot'
cukes$veg <- 'cuke'
vegLengths <- rbind(carrots, cukes)
ggplot(vegLengths, aes(length, fill = veg)) +
geom_density(alpha = 0.2)
现在说我只想绘制x=-5000 到5000 之间的区域,而不是整个范围。
我该怎么做?
【问题讨论】: