作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
下面的脚本
library(ggplot2)
dat<-rnorm(80)
dat<-data.frame(dat)
p<-ggplot(dat, aes(x=dat))+geom_histogram()
p<-p+geom_rug(sides="b", colour="blue")
p
p<-p+geom_rug(sides="b", position="jitter", colour="blue")
stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this. Error: position_jitter requires the following missing aesthetics: y
y
直方图的坐标是直方图应该自动生成的计数。
最佳答案
您可以简单地在 aes
中给出 0 的 y调用,它会绘制一切正常:
p + geom_rug(sides = "b", aes(y = 0), position = "jitter", colour = "blue")
dat <- c(rep(1, 50), rep(2, 50))
dat <- data.frame(dat)
关于r - 带有抖动地毯的直方图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32468772/
我已经开始学习Java编程,但在做作业时遇到了问题:ps这是一个c编程作业,用它来做一个java编程: Consider a (potentially large commercial) room t
我是一名优秀的程序员,十分优秀!