2014-09-08 5 views
0

여기에 내 원래 질문 : 나는 또한 올바른 anwser이며, "티스트"에 의해 주어진 방법을 사용ggplot2에서 y- 틱에 의해 부분적으로 차단 된 내 ylab을 어떻게 완전히 표시 할 수 있습니까?

In ggplot2, how can I set y-labs separately for double-panel plots?

** 그리고 후 최대한 빨리 워드 사이즈 큰 변화에 따라 , 단어의 일부가 패널의 흰색 여백에 의해 커튼되었습니다. 그래서이 문제를 해결하는 방법은 무엇입니까? 여기

g = ggplotGrob(p) 
g = gtable_add_grob(g, list(textGrob("upper panel", just = "top", rot=90, gp=gpar(fontsize=20)), 

         textGrob("lower panel", just = "top", rot=90, gp=gpar(fontsize=20))), 

         t = c(3,5), l = 1) 
g$widths[[1]] = unit(1, "line") 
grid.newpage() 
grid.draw(g) 

플롯됩니다 : enter image description here

답변

1

글쎄, 당신이 그렇게 글꼴 크기를 변경할 때, 폭을 시도 ** 여기

그의 코드의 수정 된 코드입니다 넓은. 또는이 경우, grobheight

g = ggplotGrob(p) 
g = gtable_add_grob(g, 
    ng<-list(textGrob("upper panel", just = "top", rot=90, gp=gpar(fontsize=20)), 
    textGrob("lower panel", just = "top", rot=90, gp=gpar(fontsize=20))), 
    t = c(3,5), l = 1 
) 
g$widths[[1]] = unit(.5, "grobheight", ng) 
grid.newpage() 
grid.draw(g) 

enter image description here

의 비율로 설정