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的更多相关文章

  1. 39. Volume Rendering Techniques

    Milan Ikits University of Utah Joe Kniss University of Utah Aaron Lefohn University of California, D ...

  2. 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 ...

  3. ggplot2包--R可视化

    1.ggplot2发展历程 ggplot2是Hadley在爱荷华州立大学博士期间的作品,也是他博士论文的主题之一,实际上ggplot2还有个前身ggplot,但后来废弃了,某种程度上这也是Hadley ...

  4. 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 ...

  5. Plotting means and error bars (ggplot2)

    library(ggplot2) ############################################# # summarySE ######################### ...

  6. 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 ...

  7. Matlab绘图基础——用print函数保存图片(Print figure or save to file)

    print(figure_handle,'formats','-rnumber','filename')  %将图形保存为png格式,分辨率为number的(默认为72),最好指定的分辨率大一点,否则 ...

  8. Calculus on Computational Graphs: Backpropagation

    Calculus on Computational Graphs: Backpropagation Introduction Backpropagation is the key algorithm ...

  9. Matlab绘图基础——用print函数批量保存图片到文件(Print figure or save to file)

    一.用法解析 1.1. 分辨率-rnumber 1.2.  输出图片的“格式”formats 二.用法示例 2.1. 设置输出图片的“图像纵横比” 2.2. Batch Processing(图片保存 ...

随机推荐

  1. Xcode8兼容iOS7以及低版本Xcode调试高版本iOS系统

    我们使用Xcode8新建的工程,默认支持的最低系统是iOS8,我们可以手动更改版本到7.0,但是不支持真机调试. 现在的项目一般都要兼容iOS7系统,同时也要兼容iOS10,在Xcode8上面,默认情 ...

  2. 值得收藏:一份非常完整的 MySQL 规范

    一.数据库命令规范 所有数据库对象名称必须使用小写字母并用下划线分割. 所有数据库对象名称禁止使用 MySQL 保留关键字(如果表名中包含关键字查询时,需要将其用单引号括起来). 数据库对象的命名要能 ...

  3. Linux相关代码

    Linux ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ---- ...

  4. topcoder srm 580 div1

    problem1 link 最优选择一定是在$2n$个端点中选出两个. problem2 link 分开考虑每个区间.设所有区间的左端点的最大值为$lc$,所有区间的右端点的最小值为$rc$.对于某个 ...

  5. Hadoop Streaming 使用及参数设置

    http://www.cnblogs.com/hopelee/p/7476145.html https://blog.csdn.net/djy37010/article/details/5505103 ...

  6. 【Git】git error记录之 "unpacking the sent packfile failed on the remote"

    错误信息: error: cannot open .git/FETCH_HEAD: Permission denied unpacking the sent packfile failed on th ...

  7. [转载]Black-Scholes 模型中 d1,d2 是怎么得到的?如何理解 Black-Scholes 模型?

    https://www.optbbs.com/thread-253244-1-1.html

  8. _quest_mod

    该功能实现对任务的优化,设定接受任务的条件,比如VIP等级几或者军衔多少持有何种物品才可以接受任务,同时可以配置任务的随机奖励及几率,以上修改都会在任务文本中体现.还支持任务传送功能,接完任务后,可和 ...

  9. WIN8外包公司—长年承接WIN8(surface)应用外包—北京动点飞扬软件

    WIN8外包公司—长年承接WIN8(surface)应用外包 一.我们长年专门承接WIN8外包.Surface外包. WPF 外包.HTML5外包.WindowsPhone 外包.Silverligh ...

  10. 使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题分析

    有时候我们需要直接用jdk提供的java命令来执行class文件让软件运行起来,特别是很多初学者,但经常会发现如下提示: 用eclipse或用ant则没有问题. 其实原因很简单,我们忽略了2个细节. ...