调整情节标题(主)位置 [英] Adjust plot title (main) position

查看:81
本文介绍了调整情节标题(主)位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直无法找到一种方法来使用par来调整R中的情节和主标题之间的(垂直)距离.在此示例中:

I have been unable to find a way to adjust the (vertical) distance between plot and main title in R using par. In this example:

plot(1, 1, main = "Title")

我可以使用以下方法调整轴标题的位置:

I can adjust the position of the axis titles using:

par(mgp = c(2.5, 1, 0))

但是我看不到类似地调整主标题的方法.我知道可以使用titlemtext进行更多的手动控制,但是我认为也可以使用par设置标题距离,这对我来说将是一个更优雅的选择.

But I see no way to similarly adjust the main title. I am aware that more manual control is possible using title or mtext, but I assume that there is a way setting the title distance using par as well, which would be more elegant for my purposes.

推荐答案

我们可以使用title()函数使用line负值来缩小标题.

We can use title() function with negative line value to bring down the title.

请参见以下示例:

plot(1, 1)
title("Title", line = -2)

这篇关于调整情节标题(主)位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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