panel.axis交错轴标签

时间:2019-06-26 01:18:15

标签: r lattice

我正在使用此代码绘制曼哈顿地块 https://genome.sph.umich.edu/wiki/Code_Sample:_Generating_Manhattan_Plots_in_R

但是我的xaxis标签全部重叠了。 我尝试更改为check.overlap = T

但是它只是省略了一些x标签以避免重叠,但是我需要显示所有内容。

enter image description here

 #custom axis to print chromosome names
  axis.chr <- function(side,...) {
    if(side=="bottom") {
      panel.axis(side=side, outside=T,
                 at=((posmax+posmin)/2+posshift),
                 labels=levels(chr), 
                 ticks=F, rot=0,
                 check.overlap=F
      )
    } else if (side=="top" || side=="right") {
      panel.axis(side=side, draw.labels=F, ticks=F);
    }
    else {
      axis.default(side=side,...);
    }
  }

似乎我需要像这样交错,但不知道如何。

enter image description here

0 个答案:

没有答案
相关问题