楼主: previal
5696 1

[问答] xyplot和ggplot2如何设定plot area, figure margin area 和outer margin area? [推广有奖]

  • 1关注
  • 1粉丝

硕士生

46%

还不是VIP/贵宾

-

威望
0
论坛币
22 个
通用积分
0
学术水平
5 点
热心指数
6 点
信用等级
3 点
经验
645 点
帖子
93
精华
0
在线时间
138 小时
注册时间
2010-5-24
最后登录
2015-7-7

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
大家好,我是R新手,最近在用xyplot和ggplot2做scatterplot. 我用两种方法做了同样的scatterplot,同样设定了margin,为什么出来的图大小不一样呢?
这是想要的size:
  top.margin <- 1.44
  bottom.margin <- 0.83
  left.margin <- 1.3
  right.margin <- 1.32
  paper.width <- 11.7
  paper.height <- 8.3
1. xyplot  用lattice制定margin:
lr.margin <- list(left.padding = list(x = left.margin, units = "inches"))
lr.margin$right.padding <- list(x = right.margin, units = "inches")
tb.margin <- list(bottom.padding = list(x = bottom.margin, units = "inches"))
tb.margin$top.padding <- list(x = top.margin, units = "inches")
lattice.options = list(layout.widths = lr.margin, layout.heights = tb.margin)
2. ggplot2 用plot.margin指定margin:
plot.margin=unit(x=c(top.margin,right.margin,bottom.margin,left.margin),units="inches")

为什么出来的结果不一样呢???关于R plot margin,我看过一个presentation介绍包括plot area, figure margin area 和outer margin area. 到底怎样把title和plot area一起算进figure margin area呢,凌乱了。。。
二维码

扫码加我 拉你入群

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

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

关键词:ggplot2 margin Figure gplot area figure 如何

I believe I can fly,and I can touch the sky!
沙发
DM小菜鸟 发表于 2015-3-25 17:25:29 |只看作者 |坛友微信交流群
你试一下换成设置left.margin

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-6 11:17