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

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

问题描述

我一直无法找到一种方法来使用 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天全站免登陆