Layer::position ggplot2
Position adjustments
이산형 값, 특히, bar plot이나 histogram의 stacking효과를 위한 객체위치 튜닝 주로 사용.
"identity"
(default, 특별한 배치가 필요없이 있는 그대로 배치)
"dodge"
"fill"
ggplot(diamonds) + geom_bar(aes(x=cut, fill=cut)) ggplot(diamonds) + geom_bar(aes(x=cut, fill=clarity))
ggplot(diamonds) + geom_bar(aes(x=cut, fill=clarity), position="identity") ggplot(diamonds) + geom_bar(aes(x=cut, fill=clarity), position="dodge") ggplot(diamonds) + geom_bar(aes(x=cut, fill=clarity), position="fill")
많은 점들이 overlap되었을때 overplotting. 문제가 있다고 하고, geom_point(position = "jitter")
: geom_jitter()
.를 이용하여 해결한다.
ggplot(mpg) + geom_point(aes(x = displ, y = hwy), position = "jitter")