在R语言的基础绘图系统中,有plot, figure, outer, inner 共4种边框;

这四种边框实际上明确了整个绘图设备的布局

1) outer,  当我们声明一个绘图设备的时候,outer 指的就是这个设备上,下,左,右4个边框

代码示例:

plot(1:5)
box(which = "outer", col = "red", lwd = 10)

生成的图片如下:

可以看到 outer 边框为整个绘图设备最外圈的边框

2) inner : outer 是整个绘图设备最外圈,inner 边框中就是实际用于绘图的区域,默认情况下整个绘图设备都用于绘制图表,所以inner 边框和 outer 边框是重合的,通过设置 outer margin 可以将 inner  和 outer  边框区分开

代码示例:

par(omi = c(1, 1, 1, 1))
plot(1:5)
box(which = "outer", col = "red", lwd = 10)
box(which = "inner", col = "blue", lwd = 5)

生成的图片如下:

通过设置outer magin , 可以看到 inner  边框为蓝色, 红色的是 outer  边框

3)figure : inner 边框中为实际的绘图区域, 对于绘图区域,有时有可以分成多个子区域,每个区域用来绘制一幅图,figure 指的就是每一副图的边框

代码示例:

par(omi = c(1, 1, 1, 1), mfrow = c(1, 2))
plot(1:5)
box(which = "figure", col = "red", lwd = 2)
plot(1:5)
box(which = "figure", col = "blue", lwd = 2)

生成的图片如下:

这里将绘图区域分成了两个子区域,从图中可以看出,figure 是每个子图的边框

4) plot : 每幅图的坐标系所处的边框

代码示例:

par(omi = c(1, 1, 1, 1), mfrow = c(1, 2))
plot(1:5)
box(which = "plot", col = "red", lwd = 2)
box(which = "figure", col = "red", lwd = 2)
plot(1:5)
box(which = "plot", col = "blue", lwd = 2)
box(which = "figure", col = "blue", lwd = 2)

生成的图片如下:

从图中可以看出,plot 边框就是每个子图的坐标系所处的边框, 在 plot 边框和 figure 边框之间处所的空白区域就是 margin

最新文章

  1. dedecms功能性函数封装(XSS过滤、编码、浏览器XSS hack、字符操作函数)
  2. FreeBSD_11-系统管理——{Part_3-网络}
  3. jquery选中将select下拉框中一项后赋值给text文本框
  4. [开发笔记]-WindowsService服务程序开发
  5. 分享一道我认为非常有思考价值JavaScript题目
  6. C++学习笔记:List容器
  7. ubuntu usb权限问题解决
  8. Hibernate 一对多注解 mappedby 作用
  9. .net dynamic动态加属性
  10. js实现二叉树
  11. C语言strcpy,strncpy和strlcpy讲解
  12. scrapy学习笔记(1)
  13. ModelBiner不验证某个属性
  14. 第一个VS2015 Xaramin Android项目(终)
  15. Wannafly挑战赛25游记
  16. hustoj升级
  17. Zabbix监控系统
  18. Mysql计算并保留两位小数
  19. freemarker中的null异常处理以及!与??的使用(转)
  20. B-树(B+树) 学习总结

热门文章

  1. 多媒体文件格式之TS
  2. apache ab压力测试报错apr_socket_recv
  3. 利用order by 进行盲注
  4. Laravel 5.4 Cache::put的一个小坑
  5. Android 开发自己的网络收音机2——电台列表(SlidingMenu侧滑栏)
  6. hexo静态博客的安装及应用实践记录
  7. PostgreSQL Table Partitioning<转>
  8. android——字符串string(转)
  9. Knockout开发中文API系列4–监控属性数组
  10. IDEA成功注册方法