Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 ggplot2 对基因组数据进行一些绘图,所以基本格式是有一条染色体和一个沿它的位置。我将位置转换为连续比例,然后将断点放在染色体的边界上:
scale_x_continuous("Genome Position", breaks = c(0, cumsum(chromosome_length)))
就实际绘图而言,这看起来很棒,但是标签随后被放置在染色体的开头和结尾。我希望它们沿着每条染色体居中,在默认情况下绘制小断裂的位置。
这可能吗?
这个怎么样?
breaks <- c(0, cumsum(chromosome_length)) scale_x_continuous("Genome Position", breaks = breaks + 0.5, labels = breaks)