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(图片保存 ...
随机推荐
- asp.net 后台 get,post请求
//Post请求 public static string Post(string url,string obj=null) { string param = (obj);//参数 byte[] bs ...
- 王之泰201771010131《面向对象程序设计(java)》第七周学习总结
王之泰201771010131<面向对象程序设计(java)>第七周学习总结 第一部分:理论知识学习部分 第五章 第五章内容深度学习: 继承:如果两个类存在继承关系,则子类会自动继承父类的 ...
- 马上AI全球挑战者大赛-违约用户风险预测
方案概述 近年来,互联网金融已经是当今社会上的一个金融发展趋势.在金融领域,无论是投资理财还是借贷放款,风险控制永远是业务的核心基础.对于消费金融来说,其主要服务对象的特点是:额度小.人群大.周期短, ...
- perl常用总结
1. #!usr/bin/perl use warnings; use strict; use Getopt::Long; use File::Basename; use PerIO::gzip; ...
- GPU并行的基础知识
- JS开发工具WebStorm使用快捷键
快捷键可以提高开发效率,最好用的就是这些! 代码编辑 Ctrl + d 复制整行 Ctrl + '-/+' 模块折叠 Ctrl + [ ] 括号匹配 Ctrl + F12 结构展示 Shif ...
- 解决依赖冲突:maven-enforcer-plugin插件
我们会经常碰到这样的问题,在pom中引入了一个jar,里面默认依赖了其他的jar包.jar包一多的时候,我们很难确认哪些jar是我们需要的,哪些jar是冲突的.此时会出现很多莫名其妙的问题,什么类找不 ...
- Linux上 发布.Net Core
环境准备 下面我们使用VM虚拟机.我这里安装的Linux系统是centos7 软件提供: VM: https://www.vmware.com/cn.html centos7 Minimal :htt ...
- [Java] int 转换为BigDecimal
new BigDecimal(int i); BigDecimal.parseBigDecimal(String.valueOf(int i));
- 相似性 similarity | Pearson | Spearman | p-value | 相关性 correlation | 距离 distance | distance measure
这几个概念不能混淆,估计大部分人都没有完全搞懂这几个概念. 看下这个,非常有用:Interpret the key results for Correlation euclidean | maximu ...