title: Plotting with axis labels in different location to grid lines in ggplot
body: <p>I'm attempting to plot a something called a manhattan plot, a common type of plot in genome-wide association studies (genomics). On the x-axis is position in base pairs and on the y-axis is -log10(p-value) with each point on the plot representing a particular genetic polymorphisms (mutation). Each colour represents a different chromosome.</p>
  
  <p>I have a data frame called <code>data_geno</code> with variables <code>x_pos</code> containing position along x-axis, <code>p</code> with the p-value (used for determining y-axis value) and <code>chr</code> which gives the chromosome number (from 1 to 26). The variable <code>last_bp_vec</code> literally contains the largest x-axis position of each chromosome.</p>
  
  <p>From the following code:</p>
  
  <pre><code>ggplotcmd &lt;- ggplot(data_geno, aes(x=x_pos, y=-log10(p), color=chr)) + 
      scale_x_continuous(breaks = last_bp_vec,minor_breaks=NULL,labels=seq(26)) + 
      geom_hline(aes(yintercept=-log10(5e-08))) + 
      geom_point(shape=20, size = 1) + 
      geom_point(data=data_imp,color="black",shape=4) + 
      xlab("") + 
      theme(axis.text.x = element_text(hjust=0)) +  
      scale_color_manual(values=c("deeppink2", "orange", "green2", "blue", "yellow", 
          "purple",  "magenta", "darkgreen", "gold", "firebrick", "yellowgreen", "red", 
          "black", "turquoise3", "tomato", "darkblue", "chocolate", "violet", "slategray4", 
          "OrangeRed", "darkblue", "deeppink", "aquamarine3", "steelblue1", "mediumorchid", 
          "yellowgreen")) + 
      ggtitle(man_title)
  </code></pre>
  
  <p>I have produce a plot like this:</p>
  
  <p><a href="https://i.stack.imgur.com/hRPig.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hRPig.png" alt="Manhattan plot"></a></p>
  
  <p>All I wish to do is shift the x-axis label positions to the middle of their respective bunch of points (so I don't rely on a legend), i.e. I wish the "1" to sit under the middle position of the magenta coloured points and "2" to sit under the middle of the orange points etc... The x-axis ticks and grid lines are in the correct position and I wish to keep those there.</p>
  
  <p>I'm aware of the solution using <code>theme(axis.text.x = element_text(hjust=VALUE))</code> but this doesn't work as it shifts each label by the same amount and since chromosomes are different sizes, I need each label shifted by a different amount.</p>
  
  <p>I'm still learning to use ggplot and (more generally) R, so please do correct me if I'm doing something horribly wrong or if there's a much simpler way to achieve what I'm attempting to do!</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Thanks.</p>