2016-08-01 3 views
0

x 축과 x tick 사이의 공백을 제거하고 싶습니다. 빨간색 직사각형 영역입니다. 예 :x 축 x tick 사이의 영역 제거

ggplot(mtcars, aes(factor(cyl))) + geom_bar() 

x 레이블 간격에 많은 정보가 있지만 x 레이블과 x 축 사이의 거리가 아닙니다.

enter image description here

답변

0

그냥 ggplotscale_y_continuous(expand = c(0,0))을 추가

ggplot(mtcars, aes(factor(cyl))) + geom_bar() + 
    scale_y_continuous(expand = c(0, 0)) 

Boxplot with removed area between x-axis and plot-area