[英]How does one move the tick labels closer to the axis?
版本2.0.0
引入了新的margin()
,我们可以在这里使用:
ggplot(mtcars, aes(x = mpg, y = wt*1000, color = factor(cyl))) +
geom_point() +
ylab("weight (lb)") +
theme_bw() +
theme(axis.text.y = element_text(margin = margin(r = 0)))
我在github上对这个问题的解读是,你应该只将vjust
用于y-axis
, hjust
仅仅用于x-axis
。 以改变蜱标签和轴之间的距离,可使用margin(r = x)
上的y轴,和margin(t = x)
上的x-axis
。 doc for element_text
文档是:“创建主题时,边距应放在文本的一侧,面向图的中心。”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.