ggplot2 multiply graphs on one figure
library(ggplot2)
library(grid)
grid.newpage()
pushViewport(viewport(layout = grid.layout(1,2)))
vplayout = function(x, y) viewport(layout.pos.row = x, layout.pos.col = y)
b<-matrix(1:2,ncol=2,byrow=T)
for (i in 1:2){
r<-which(b==i,arr.ind=T)
read.table(paste("JTK.maize",i,".incluster.txt",sep=''),header=F)->data1
p<-ggplot(data1, aes(V2))+geom_histogram(breaks=seq(0,24,2),col="black",fill="lightgrey")+labs(title=paste("Maize",i,sep=' '),x="LAG")+theme(axis.line = element_line(colour = "black",size = 0.5),panel.background=element_rect(fill='transparent', color='gray'),legend.key=element_rect(fill='transparent', color='transparent'),axis.text=element_text(color="black",size=10))+scale_x_continuous(limits=c(0,24),breaks=seq(0,24,4))
print(p,vp = vplayout(r[1],r[2]))
}
ggplot2 multiply graphs on one figure的更多相关文章
- 39. Volume Rendering Techniques
Milan Ikits University of Utah Joe Kniss University of Utah Aaron Lefohn University of California, D ...
- R + ggplot2 Graph Catalog(转)
Joanna Zhao’s and Jenny Bryan’s R graph catalog is meant to be a complement to the physical book,Cre ...
- ggplot2包--R可视化
1.ggplot2发展历程 ggplot2是Hadley在爱荷华州立大学博士期间的作品,也是他博士论文的主题之一,实际上ggplot2还有个前身ggplot,但后来废弃了,某种程度上这也是Hadley ...
- Intel® Threading Building Blocks (Intel® TBB) Developer Guide 中文 Parallelizing Data Flow and Dependence Graphs并行化data flow和依赖图
https://www.threadingbuildingblocks.org/docs/help/index.htm Parallelizing Data Flow and Dependency G ...
- Plotting means and error bars (ggplot2)
library(ggplot2) ############################################# # summarySE ######################### ...
- Safari HTML5 Canvas Guide: Creating Charts and Graphs
Safari HTML5 Canvas Guide: Creating Charts and Graphs Bar graphs are similar to data plots, but each ...
- Matlab绘图基础——用print函数保存图片(Print figure or save to file)
print(figure_handle,'formats','-rnumber','filename') %将图形保存为png格式,分辨率为number的(默认为72),最好指定的分辨率大一点,否则 ...
- Calculus on Computational Graphs: Backpropagation
Calculus on Computational Graphs: Backpropagation Introduction Backpropagation is the key algorithm ...
- Matlab绘图基础——用print函数批量保存图片到文件(Print figure or save to file)
一.用法解析 1.1. 分辨率-rnumber 1.2. 输出图片的“格式”formats 二.用法示例 2.1. 设置输出图片的“图像纵横比” 2.2. Batch Processing(图片保存 ...
随机推荐
- Python爬虫(三)——开封市58同城出租房决策树构建
决策树框架: # coding=utf-8 import matplotlib.pyplot as plt decisionNode = dict(boxstyle=') leafNode = dic ...
- 字段值为 null 时,序列化或反序列化成其他值
using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; using System.Collections.G ...
- vue+iview实现table和分页及与后台数据交互
最近在项目中遇到使用table分页的功能,所以分享出来给大家希望能够对大家有帮助,话不多说直接上代码 <template> <div> <Table :columns=& ...
- [JSTL - fmt] fmt标签格式化日期
<span ><fmt:formatDate value="${ann.adate }" pattern="yyyy-MM-dd"/>& ...
- 继承ActionSupper类报错 --Struts2
如下图所示,继承ActionSupper类报错: 原因:缺少Struts2中JAR包,具体是:
- Practical Node.js (2018版) 13章, Node HTTP/2 Servers
新增的章节. If you are not using HTTP/2, then you are losing out on big improvements. HTTP/2相比http/1有很大的区 ...
- rsync详细配置
1 说在前面的话 rsync官方网站: https://www.samba.org/ftp/rsync/rsync.html rsync是可以实现增量备份的工具.配合任务计划,rsync能实现定时或间 ...
- 普元eos、soa、esb
http://www.primeton.com/support/video.php http://www.primeton.com/products/bps/overview.php http://w ...
- 3D打印GCODE文件学习(二)
大家可以自己实践一下,那么怎么打开GCODE呢?很简单,只要在桌面上创建一个word文档,然后把“.”后面的docx改成GCODE,它会跳出一个是否更改的框,点击是就行了,然后右键,点击Edit wi ...
- vue-router进阶-2-路由原信息
//meta字段,一个路由匹配到的所有路由记录会暴露为 $route 对象(还有在导航守卫中的路有对象)的 $route.matched 数组. const router = new VueRoute ...