条形图以及分组条形图
以及 分组 条形图
2023-06-13 09:13:59 时间
一、条形图
# 实践:绘制人染色体长度分布图
x <- read.csv(file = "homo_length.csv",header = T)
head(x)
x <- x[1:24,]
barplot(height = x$length)
barplot(height = x$length,names.arg = x$chr)
barplot(height = x$length,names.arg = x$chr,las =3)
barplot(height = x$length,names.arg = x$chr,las =3,col = rainbow(4))
barplot(height = x$length,names.arg = x$chr,las =3,col = 'red')
barplot(height = x$length,names.arg = x$chr,las =3,col = c('red','green'))
library(RColorBrewer)
display.brewer.all()
cols <- brewer.pal(n = 6,name = "RdPu")
barplot(height = x$length,names.arg = x$chr,col = cols)
cols <- brewer.pal(n = 6,name = "Dark2")
barplot(height = x$length,names.arg = x$chr,col = cols)
cols <- brewer.pal(n = 6,name = "Blues")
barplot(height = x$length,names.arg = x$chr,col = cols)
cols <- brewer.pal(n = 6,name = "Set1")
barplot(height = x$length,names.arg = x$chr,col = cols,las=3)
barplot(height = x$length,names.arg = x$chr,col = cols,horiz = T,las=2)
par('mar')
barplot(height = x$length,names.arg = x$chr,col = cols,horiz = T,las=2,
border = F,width = c(1,2),space = 0.1)
barplot(height = x$length,names.arg = x$chr,las=2,
border = F,width = c(1,2),space = 1,density = 12,angle = c(45,135))
人染色体长度分布图
二、分组条形图
#绘制分组条形图
x <- read.csv("sv_distrubution.csv",header = T,row.names = 1)
head(x)
#barplot(x)
barplot(as.matrix(x))
barplot(t(as.matrix(x)))
# barplot(t(as.matrix(x)),col = rainbow(4))
barplot(t(as.matrix(x)),col = brewer.pal(4,name = 'Set2'))
barplot(t(as.matrix(x)),col = brewer.pal(4,name = 'Set2'),beside = T)
barplot(t(as.matrix(x)),col = brewer.pal(4,name = 'Set2'),
horiz = F,density = 30,angle = c(45,135))
barplot(t(as.matrix(x)),col = brewer.pal(4,name = 'Set2'))
barplot(t(as.matrix(x)),col = brewer.pal(4,name = 'Set2'),legend.text = colnames(x),ylim = c(0,800),
main = "SV Distribution",xlab="Chromosome Number",ylab="SV Numbers")
堆叠条形图
写在最后:有时间我们会努力更新的。大家互动交流可以前去论坛,地址在下面,复制去浏览器即可访问,弥补下公众号没有留言功能的缺憾。原地址暂未启用(bioinfoer.com)。
sx.voiceclouds.cn
有些板块也可以预设为大家日常趣事的分享等,欢迎大家来提建议。
相关文章
- tof 相机的数据读取,depth data和amplitude data以及3D数据[通俗易懂]
- SpringSecurity的集成以及相关组件的介绍
- Nexus私服配置以及分组的应用
- Echarts 地图生成 以及生成geojson文件(附带完整代码)
- 【Redis高手修炼之路】客户端工具——客户端工具以及常用命令
- Laravel框架对于中间件{参数}的深入运用以及请求参数的实战
- 第五届XCTF总决赛的赛制以及新型攻防赛题之探索
- VMware-ESXI-6.7修改静态IP地址和主机名称以及许可证
- 【Android 安全】DEX 加密 ( Proguard keep 用法 | Proguard 默认混淆结果 | 保留类及成员混淆结果 | 保留注解以及被注解修饰的类/成员/方法 )
- MYSQL学习之安装、主从复制、读写分离原理解析以及详细配置(MySQL5.7)详解数据库
- JSP常见错误以及解决方案
- checkbox全选/取消全选以及checkbox遍历jQuery实现代码
- PHP伪静态技术原理以及突破原理实现介绍
- php显示当前文件所在的文件以及文件夹所有文件以树形展开
- jquery序列化表单以及回调函数的使用示例