增加y轴上文本和标题之间的距离
Y轴标题看起来离轴文本太近了。
ggplot(mpg, aes(cty, hwy)) + geom_point() 

 我曾尝试更改theme()的许多参数的值,但似乎没有帮助。 
 从ggplot2 2.0.0你可以使用element_text()的margin =参数来改变轴标题和数字之间的距离。 在元素的t op,right,bottom和lft侧设置margin的值。 
 ggplot(mpg, aes(cty, hwy)) + geom_point()+ theme(axis.title.y = element_text(margin = margin(t = 0, r = 20, b = 0, l = 0))) 
  margin也可以用于其他element_text元素(请参阅?theme ),如axis.text.x , axis.text.y和title 。 
根据此论坛post: https : //groups.google.com/forum/#!topic/ggplot2/mK9DR3dKIBU
听起来最简单的做法是在x轴之前和y轴标签之后添加换行符(\ n)。 似乎比上面提到的解决scheme更容易(虽然是笨重的)。
 ggplot(mpg, aes(cty, hwy)) + geom_point() + xlab("\nYour_x_Label") + ylab("Your_y_Label\n") 
希望有所帮助!