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. 解决ajax异步请求数据后swiper不能循环轮播(loop失效)问题、滑动后不能轮播的问题。

    问题描述: 1.我使用axios异步请求后台的图片进行渲染后不能实现循环轮播,也就是loop失效,但是静态写死的情况下不会出现这种问题. 2. 分析: swiper的机制是:初始化的时候将swiper ...

  2. VS2013的x86汇编语言开发环境配置

    转载:https://blog.csdn.net/infoworld/article/details/45085415 转载:https://blog.csdn.net/u014792304/arti ...

  3. Bioconductor软件安装与升级

    1 安装工具Bioc的软件包不能使用直接install.packages函数,它有自己的安装工具,使用下面的代码: source("https://bioconductor.org/bioc ...

  4. Tomcat配置服务和自启动

    Tomcat配置服务和自启动1.Tomcat配置服务 假设Tomcat的安装路径为/usr/local/tomcat 1 为Tomcat添加启动参数 catalina.sh在执行的时候会调用同级路径下 ...

  5. appDesign

    1原则 简约,实用,懒人模式 2模块划分 以实用目的,而非以工具

  6. yum命令报错 yum update File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: --CentOS7.5

    1.问题: 使用yum命令如:yum update 报SyntaxError invalid syntax 2.原因分析 yum的解释器是Python,CentOS自带的yum采用(自带的)pytho ...

  7. AVL平衡二叉树实现

    #include<stdio.h> #include<stdlib.h> #define TRUE 1 #define FALSE 0 #define EH 0 #define ...

  8. sql 同一个字段在查询结果中出现两次

    SELECT GET .daytime,    GET.data AS GET,    xh.data AS xh FROM    ( SELECT daytime, SUM ( get_sum ) ...

  9. coursera-斯坦福-机器学习-吴恩达-笔记week2

    1 多元线性回归 1.1 假设函数 多元线性回归是指有多个特征特征变量的情况.此时我们修改假设函数hθ(x)=θ0+θ1∗x为hθ(x)=θ0+θ1x1+θ2x2+⋯+θnxn.设x0=1,x为特征向 ...

  10. PC/FORTH 变量|常数|数组

    body, table{font-family: 微软雅黑} table{border-collapse: collapse; border: solid gray; border-width: 2p ...