scale_y _... (breaks = c (x1, x2)) 함수를 사용하지 않고 플롯에서 나누기를 설정하는 방법을 찾고있었습니다. 문제는 다음과 같습니다. 상자 플롯을 원합니다.ggplot2에서 scale_y_continuous()없이 중단
require(ggplot2)
a <- rnorm(10, 0, 5)
a <- as.data.frame(a); colnames(a) <- "test"
### original boxplot
ggplot(data=a, mapping=aes(y=test, x=rep(1,10))) +
geom_boxplot()
### scale_y_continous() cuts of my data points and changes the boxplot!
ggplot(data=a, mapping=aes(y=test, x=rep(1,10))) +
geom_boxplot() +
scale_y_continuous(limits=c(-1,1), breaks=c(-1,0,1))
### I am therefore using coord_cartesian() but I am missing a breaks() function
ggplot(data=a, mapping=aes(y=test, x=rep(1,10))) +
geom_boxplot() +
coord_cartesian(ylim = c(-1,1)) # +
# breaks(c(-1,0,1)) # something like this
도움 주셔서 감사합니다.
왜 궁금한데 왜 박스 플롯을 확대하고 싶습니까? – Arun
확대/축소에 대해서는별로 중요하지 않지만 일렬을 나란히 배치 한 여러 개의 상자 그림에 대해 일정하게 유지하는 것이 중요합니다. –
그런 경우,'log-scale' (또는)'facet'을'scales = "free"'와 사용하는 것이 더 낫습니다. – Arun