使用dup_axis()在ggplot2中复制轴刻度线对齐精度?

时间:2017-10-05 17:51:33

标签: r ggplot2

刻度线(和标签)没有精确对齐在上面的重复轴上(检查顶部的“0”)我找不到原因。我只有一次调用x轴:

scale_x_continuous(expand = c(0.01, 0.01), limits = c(-550, 1000), 
  breaks = c(-550,-500,-400,-300,-200,-100,-50,-25, 0,25,50, 100, 200, 300, 400, 500, 750, 1000),
  labels = c("", "500", "400", "300", "200","100","50","25", "0","25","50", "100", "200", "300", "400", "500", "750", "1 maf"), 
                     sec.axis = dup_axis()) 

enter image description here

感谢您的任何想法。

0 个答案:

没有答案