Placement of axis labels at minor breaks with ggplot2

Posted by JAShapiro on Stack Overflow See other posts from Stack Overflow or by JAShapiro
Published on 2009-10-12T14:36:58Z Indexed on 2010/05/11 0:04 UTC
Read the original article Hit count: 279

Filed under:
|

I am using ggplot2 to do some plotting of genomic data, so the basic format is that there is a chromosome and a position along it. I convert the positions to be on a continuous scale, then put the breaks at the boundaries of the chromosomes with:

scale_x_continuous("Genome Position", breaks = c(0, cumsum(chromosome_length)))

That looks great, as far as the actual plotting is concerned, but the labels are then put at the start and end of the chromosomes. I would like them to be centered along each chromosome, at the position where the minor break is drawn by default.

Is this possible?

© Stack Overflow or respective owner

Related posts about r

    Related posts about ggplot2