[英]R plotly histogram uncorrect observations count
I'm having some trouble with an histogram plot with plotly. 我在使用plotly直方图时遇到了一些麻烦。 It seems that the bins are wrong populated.
似乎垃圾箱的填充错误。 Why?
为什么?
aaa<-seq(-0.1,0.45,0.005)
plot_ly(y=~aaa,
type="histogram",
showlegend=FALSE,
autobiny=FALSE,
ybins=list(
start=-0.1,
end=0.45,
size=0.005
),
marker=list(
line=list(
width=1
)
)
)
You could try building your histogram in ggplot2
and use the ggplotly
function like this: 您可以尝试在
ggplot2
构建直方图,并使用ggplotly
函数,如下所示:
library(ggplot2)
library(plotly)
ggplotly(ggplot(data.frame(aaa), aes(aaa)) + geom_histogram(binwidth = 0.005))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.