2014-04-18 43 views
2

我已經產生了火山圖平滑,但是底層的數據有差距,即直方圖數據的樣子:更改火山口上積

enter image description here

當我產生了火山圖看起來有點傻:

enter image description here

是否可以應用平滑的陰影區域,以消除該肋的功能;當然,它必須已經有一個光滑的相關,否則影子會回落到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

這將是更容易,如果你提供你已經一個'dput'您的數據和代碼使用 –

+0

我現在要做 – Rambatino

+0

這樣好嗎?從來沒有真正使用dput之前... – Rambatino

回答

3

使用adjustgeom_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() 

enter image description here

+0

你是明星!現在看起來如此明顯,我很驚訝沒有人在你之前到達那裏! – Rambatino