![](/img/trans.png)
[英]Normalizing y-axis in density plots in R ggplot to proportion by group
[英]Plotting density plots on the negative y axis with ggplot2, R
我正在嘗試在x軸的兩側繪制密度-試圖可視化映射到基因組區域的兩條鏈的讀段。
我有兩個問題:
我想使用ggplot2
但
我不知道如何從繪圖對象中提取數據,或者反轉已經制作的繪圖。
任何幫助,不勝感激!
您的問題尚不清楚,但是我發現“ x軸兩側的密度”可能很有趣。 因此,也許您正在嘗試執行以下操作:
d <- data.frame(x = rnorm(1000),x1 = rnorm(1000,sd = 0.5))
ggplot(data = d,aes(x = x)) +
geom_density() +
geom_density(aes(x = x1,y = -(..density..)))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.