在ggplot标题中改变行间距? [英] Change interlinear space in ggplot title?

查看:345
本文介绍了在ggplot标题中改变行间距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用 \\\
labs(title =whatever \\\
在此之后出现)
最后我在两条线之间留下了相当大的空间。有没有办法影响它? (我的意思是除了标题本身的font-size)。

If I use \n with labs(title="whatever \n comes after this") I end up with quite a big space between the lines. Is there a way to influence it? (I mean except font-size of the title itself).

推荐答案

你可以这样做(选项 lineheight

you can do something like this ( option lineheight to modify line spacing)

  p <- qplot(mpg, wt, data = mtcars)
  p <- p + ggtitle("whatever \n comes after this") + 
  theme(plot.title = element_text(lineheight=.1))
  p

这篇关于在ggplot标题中改变行间距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆