-2
누군가 geom_density
게재 순위 옵션 stack
대 identity
을 설명 할 수 있습니까? 플롯은 매우 다르게 보이지만 여전히 겹침ggplot에서 위치 스택과 ID의 차이점은 무엇입니까?
누군가 geom_density
게재 순위 옵션 stack
대 identity
을 설명 할 수 있습니까? 플롯은 매우 다르게 보이지만 여전히 겹침ggplot에서 위치 스택과 ID의 차이점은 무엇입니까?
어떤 이유인지 그것은 geom_density
도움말에 설명되어 있지 않습니다. 이 같은
position="identity"
반면 오버레이를 :
그 생성 된 코드이다 : 그러나 position="stack"
는 다음과 같이 값을 스택
n <- 1000
A <- data.frame(id='A',x=rnorm(n, 5, 2))
B <- data.frame(id='B',x=rexp(n, 1/4))
C <- data.frame(id='C',x=rexp(n, 1/8))
D <- data.frame(id='D',x=rexp(n, 1/16))
df <- rbind(A,B,C,D)
colorset = c('B'='red','A'='green','D'='black','C'='blue' )
ggplot(df, aes(x)) +
geom_density(aes(fill = id), alpha = .4, adjust = 2,position="stack") +
scale_fill_manual(values=colorset) +
scale_x_continuous(limits =c(0,40)) + labs(title="geom_density: position=`Stack`")
ggplot(df, aes(x)) +
geom_density(aes(fill = id), alpha = .4, adjust = 2,position="identity") +
scale_fill_manual(values=colorset) +
scale_x_continuous(limits =c(0,40)) + labs(title="geom_density: position=`identity`")
을이 답변을합니까 너의 질문? –
사진을 게시 할 때 도움이 될 수 있습니다. –