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