如何使用Circos-6:Axes 和 Backgrounds

2018-02-11  本文已影响22人  思考问题的熊

title:
tags:


说明,该系列原文写于2016年3月。

上一篇我们讲到了柱状图的基本配置,有时为了使图形表示的信息更加清楚醒目,我们需要给柱状图加上坐标轴和背景,接下来就如何添加坐标轴和背景进行一个简单的介绍。
为了贯彻可读性和简洁性的思想,我们还是把这两部分保存为两个单独的文件,然后在配置文件中进行引用。

例1:引用方法

# 一个track的 background可以是各种颜色的,通过设定 y0/y1 这个范围可以产生一个类似于条纹的效果,从而突出某些内容。

<<include backgrounds.conf>>

#后面跟要加背景的内容
</plot>
<plot>
type = histogram
file = data/5/segdup.hs1234.stacked.txt
r1 = 0.99r
r0 = 0.92r
fill_color = hs1,hs2,hs3,hs4
orientation = in
extend_bin = no
<rules>
<<include rule.exclude.hs1.conf>>
</rules>

# Like backgrounds, axes are defined in groups.
#
# spacing - 定义坐标轴的间距
# position - 定义坐标轴的位置
# position_skip - 某个位置不显示
# y0 - 范围
# y1 - 范围
# color - 坐标轴的颜色
# thickness - 线的厚度

<<include axes.conf>>

</plot>
</plots>

例2:backgrounds.conf

#注意理解含义,整体底色是一个颜色,然后给了三个相对区间,最后的效果是显示四个颜色。
<backgrounds>
# 只在有ideogram的位置显示背景
show = data
<background>
color = vvlgrey
</background>
<background>
color = vlgrey
y0 = 0.2r
y1 = 0.5r
</background>
<background>
color = lgrey
y0 = 0.5r
y1 = 0.8r
</background>
<background>
color = grey
y0 = 0.8r
</background>

</backgrounds>

例3:axes.conf

#注意理解含义,每隔0.1r画一条坐标轴,那这个track上应该有10个这样的坐标轴。如果是position=0.5r,那么说明只是在0,5r那一个位置有一条坐标轴。
<axes>
# 只在有track的地方显示坐标轴
show = data

thickness = 1
color = lgrey
<axis>
spacing = 0.1r
</axis>
<axis>
spacing = 0.2r
color = grey
</axis>
<axis>
position = 0.5r
color = red
</axis>
<axis>
position = 0.85r
color = green
thickness = 2
</axis>

</axes>

图例


加入靠谱熊基地,和大家一起交流
上一篇 下一篇

猜你喜欢

热点阅读