楼主: mengye02
14173 10

[问答] r 作图一页多图时 总标题用哪个函数? [推广有奖]

  • 1关注
  • 0粉丝

硕士生

15%

还不是VIP/贵宾

-

威望
0
论坛币
9 个
通用积分
0
学术水平
0 点
热心指数
1 点
信用等级
1 点
经验
1131 点
帖子
92
精华
0
在线时间
92 小时
注册时间
2010-4-16
最后登录
2021-10-18

楼主
mengye02 发表于 2013-12-10 16:47:42 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
r 作图时,main可以对每个小图设定标题,但一页多图时,需要有个总标题,这个怎么办呢?大家肯定都遇到过,小菜鸟一只,求指教,谢谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Main 怎么办 MAI 求指教

沙发
zhangyangsmith 发表于 2013-12-10 17:11:57
try "mtext"?

藤椅
mengye02 发表于 2013-12-10 17:22:00
zhangyangsmith 发表于 2013-12-10 17:11
try "mtext"?
好,我试一下,谢谢。

板凳
mengye02 发表于 2013-12-10 17:29:21
zhangyangsmith 发表于 2013-12-10 17:11
try "mtext"?
貌似不行,或者是我不会设置吧,还有别的方法吗?

报纸
zhangyangsmith 发表于 2013-12-10 18:07:29
mengye02 发表于 2013-12-10 17:29
貌似不行,或者是我不会设置吧,还有别的方法吗?
Well, it does require a bit more setting. You will have to change the "oma" option using the "par" function. In addition, for "mtext" you need to specify "outer = T". It should work. Here is an example:
  1. par(mfrow = c(2, 2), oma = c(0, 0, 3, 0))
  2. plot(qnorm, main = expression(Phi^{-1}))
  3. plot(qlogis, main = "The Inverse Logit : qlogis()")
  4. abline(h = 0, v = 0:2/2, lty = 3, col = "gray")
  5. curve(sin, -2*pi, 2*pi, xname = "t", main = "curve(sin)")
  6. curve(tan, xname = "t", add = NA, main = "curve(tan)")
  7. mtext("Plots of Different Functions", side = 3, line = 0, outer = T)
复制代码
There are other ways to do multiplot on one device (e.g., layout, split.screen) but I haven't found other means of adding a title to the whole page...
已有 2 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
cheetahfly + 10 精彩帖子
qoiqpwqr + 1 + 1 + 1 热心帮助其他会员

总评分: 论坛币 + 10  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

地板
mengye02 发表于 2013-12-10 19:54:21
zhangyangsmith 发表于 2013-12-10 18:07
Well, it does require a bit more setting. You will have to change the "oma" option using the "par" ...
thank you so much! yes, it now works!

7
skytreee 发表于 2013-12-11 10:08:47
mengye02 发表于 2013-12-10 19:54
thank you so much! yes, it now works!
我运行了一下楼上的代码,没发现总标题啊?楼主知道怎么做了吗,分享一下lou。

8
mengye02 发表于 2013-12-11 10:18:46
skytreee 发表于 2013-12-11 10:08
我运行了一下楼上的代码,没发现总标题啊?楼主知道怎么做了吗,分享一下lou。
我运行了是可以的。你在检查一下,par函数里的oma的设置很重要

9
mengye02 发表于 2013-12-12 14:04:57
zhangyangsmith 发表于 2013-12-10 18:07
Well, it does require a bit more setting. You will have to change the "oma" option using the "par" ...
高手,请教个问题吧?
x<-list()
为什么 is.null(x)
结果为FALSE?

这是为什么?本来想用is.null 作为剔除空list的依据呢 结果是FALSE ,这下该怎么办呢?

10
zhangyangsmith 发表于 2013-12-12 17:13:04
mengye02 发表于 2013-12-12 14:04
高手,请教个问题吧?
x
Perhaps you want to test if the length of the list is 0:
  1. x <- list()
  2. length(x)
  3. # [1] 0
复制代码

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-29 11:56