R 雨云图-直方图?
我想创建一个雨云图。我已经成功地做到了。但我想知道是否可以用直方图代替密度曲线(这对我的数据集更好)。 这是我的代码,如果可以使用的话R 雨云图-直方图?,r,ggplot2,R,Ggplot2,我想创建一个雨云图。我已经成功地做到了。但我想知道是否可以用直方图代替密度曲线(这对我的数据集更好)。 这是我的代码,如果可以使用的话 ATSC <- ggplot(data = data, aes(y = atsc, x = numlecteur, fill = numlecteur)) + geom_flat_violin(position = position_nudge(x = .2, y = 0), alpha = .5) + geom_point(aes(y = ats
ATSC <- ggplot(data = data, aes(y = atsc, x = numlecteur, fill = numlecteur)) +
geom_flat_violin(position = position_nudge(x = .2, y = 0), alpha = .5) +
geom_point(aes(y = atsc, color = numlecteur), position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_point(data = sumld, aes(x = numlecteur, y = mean), position = position_nudge(x = 0.25), size = 2.5) +
geom_errorbar(data = sumld, aes(ymin = lower, ymax = upper, y = mean), position = position_nudge(x = 0.25), width = 0) +
guides(fill = FALSE) +
guides(color = FALSE) +
scale_color_brewer(palette = "Spectral") +
scale_y_continuous(breaks=c(0,2,4,6,8,10), labels=c("0","2","4","6","8","10"))+
scale_fill_brewer(palette = "Spectral") +
coord_flip() +
theme_bw() +
expand_limits(y=c(0, 10))+
xlab("Lecteur") + ylab("Age total sans check")+
raincloud_theme
这其实并不容易。还有一些挑战
geom_柱状图
是“自然水平的”,而定制的geom_平面图
是垂直的-盒状图也是如此。因此,在该教程中最后调用coord\u flip
。为了将两者结合起来,我认为最好是切换x和y,忘记坐标翻转,而是使用ggstance::geom\u boxploth
after_stat
功能进行缩放
库(tidyverse)
我的数据你好,欢迎来到SO。为了帮助我们帮助你,链接到你的资料来源总是很好的-在你的情况下,几乎100%可能很抱歉,当我用英语翻译它时,我忘了放它!我也用过这个:P.S.数据和代码框架是基于