我制作了一个火山图,但基础数据有差距,即直方图数据如下:
当我制作火山情节时,它看起来有点傻:
是否可以在阴影区域使用更光滑的方法来熨平罗纹特征;当然,它必须已经具有与之相关的平滑度,否则阴影每次都会回落到0?
代码:
ggplot(fly2[fly2$Region == "different",], aes(x = Probability)) +
stat_density(aes(ymax = ..density.., ymin = -..density..),
fill = "grey50", colour = "grey50",
geom = "ribbon", position = "identity") +
facet_grid(. ~ Algorithm) + xlim(0,0.3) +
coord_flip()
链接到dput文件:
http://pastebin.com/ba95WEab
答案 0 :(得分:3)
在adjust
中使用geom_density
。
例如,当我使用adjust = 1.6
时,这就是我得到的
ggplot(fly2[fly2$Region == "different",], aes(x = Probability)) +
stat_density(aes(ymax = ..density.., ymin = -..density..),
fill = "grey50", colour = "grey50",
geom = "ribbon", position = "identity",
adjust=1.6) +
facet_grid(. ~ Algorithm) + xlim(0,0.3) +
coord_flip()