2017-09-25 85 views

回答

1

调整文字位置vjust选项(主题p2是你所需要的)。

library(ggplot2) 

p1 <- qplot(rownames(head(mtcars)), 1) + 
    ggtitle("vjust = 0") + 
    theme(axis.text.x = element_text(angle = 90, vjust = 0)) 
p2 <- qplot(rownames(head(mtcars)), 1) + 
    ggtitle("vjust = 0.3") + 
    theme(axis.text.x = element_text(angle = 90, vjust = 0.3)) 

gridExtra::grid.arrange(p1, p2, ncol = 2) 

enter image description here