Tal*_*ali 4 r histogram ggplot2
我正在用ggplot做直方图.
p <- ggplot(TotCalc, aes(x=x,y=100*(..count../sum(..count..)))) +
xlab(xlabel) + ylab(ylabel) +
geom_histogram(colour = "darkblue", fill = "white", binwidth=500)
Run Code Online (Sandbox Code Playgroud)
我的x在2到6580之间,我有2600个数据.
我想绘制一个不同的直方图binwidth.可能吗?
例如,我想要8个条形,宽度如下:
c(180,100,110,160,200,250,1000,3000)
Run Code Online (Sandbox Code Playgroud)
我该怎么做?
koh*_*ske 15
如何使用休息?
x <- rnorm(100)
ggplot(NULL, aes(x)) +
geom_histogram(breaks = c(-5, -2, 0, 5),
position = "identity", colour = "black", fill = "white")
Run Code Online (Sandbox Code Playgroud)
PS请不要在没有明确通知的情况下交叉发帖.

| 归档时间: |
|
| 查看次数: |
7440 次 |
| 最近记录: |