R语言中ggplot绘图设置绘图标签文字到框线的距离
001、基础绘图
library(ggplot2)#导入ggplot包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() + theme_bw() ## 基础绘图
002、调整x轴上刻度文字到框线的距离
a、设置为-4
library(ggplot2)#导入ggplot包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() + theme_bw() + theme( axis.text.x = element_text(vjust = -4)) ## 设置为-4
b、设置为4
library(ggplot2)#导入ggplot包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() + theme_bw() + theme( axis.text.x = element_text(vjust = 4)) ## 设置为4
。