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(图片保存 ...
随机推荐
- Uncaught SyntaxError: Unexpected token <解决方法
最近剥离基础框架的公共部分,早上有个页面部分流程未加载出来,报了Uncaught SyntaxError: Unexpected token <,网上搜了下 错误原因:js脚本中非正常引用外部的 ...
- win10虚拟桌面使用方法-提高工作效率
任务栏右键 => 显示任务视图按钮 然后坐下角出现的任务视图按钮可以添加虚拟桌面 快捷键: win + ctrl + 左/右 切换桌面 win + tab 打开任务视图 win + ctrl + ...
- 整型 布尔值 字符串 for循环
1.整型 2.布尔值 3.字符串 4.for循环 1.整型:.python中有长整型, Python3中只有整型 2.布尔值: bool:Ture 真 False 假 数字和布尔值可进行转 ...
- JS(JavaScript)的初了解5(更新中···)
1.函数 关键词function 首先,我们先复习一下前面的知识: var 是JS的关键字,用于声明变量,声明在内存模块完成,定义(=)是在执行模块完成. var可以在内存模块提前(JS代码执行前)完 ...
- Convolutional Pose Machines
Convolutional Pose Machines 2018-12-10 18:17:20 Paper:https://www.cv-foundation.org/openaccess/conte ...
- java Encryption&Decryption
The encryption class: package cn.com.smartcost.qy.util; import java.security.Key; import java.securi ...
- linux安装nord,卸载nord源
需要提前准备好:能使用的sock代理. 1.在这里 https://nordvpn.com/zh/download/linux/ 下载初始安装包,这包不是真正的软件,而是会给你添加一个源,大概为了安全 ...
- 基于腾讯云CentOS7.4+MySQL5.7+Python3+uwsgi+nginx的Django项目部署
准备知识 1.django一个基于python的开源web框架,请确保自己熟悉它的框架目录结构. 2.uWSGI一个基于自有的uwsgi协议.wsgi协议和http服务协议的web网关 3.nginx ...
- k-mean 拐点
n = 100g = 6 set.seed(g)d <- data.frame(x = unlist(lapply(1:g, function(i) rnorm(n/g, runif(1)*i^ ...
- localStorage(本地存储器)、sessionStorage(会话存储)
设置:localStorage.setItem("token", JSON.parse(res).data.token); 获取:that.token = localSto ...