title: How to plot a boxplot with correctly spaced continuous x-axis values in ggplot2
body: <p>I am attempting to plot a boxplot where my x-axis is a continuous time-scale which is growing degree days i.e. 0 to 2500. I would like to get a boxplot with x-axis values correctly spaced on a continuous time-scale rather than a discrete one. Normally if it were a regular time/date, I could have used a 'scale_x_date' with ggplot2 in R. However, since the numbers are outside date/time scale I am not sure how can we correctly space the x-axis values. Here is the dummy example: </p>
  
  <pre><code>library(ggplot2)
  set.seed(1234)
  #get data    
  df &lt;- data.frame(y=abs(rnorm(8)),
               x=as.factor(rep(c(0,100,200,500),times=2))) 
  ggplot(aes(y=y,x=x), data=df) + 
         geom_boxplot()
  </code></pre>
  
  <p>This gives me the plot</p>
  
  <p><img src="https://i.stack.imgur.com/FZrhT.png" alt="enter image description here"></p>
  
  <p>where my x-axis is not spaced based on its numeric values. Instead, I would like to get a boxplot where the spacing between 200 to 500 should be three times more than 100-200. My actual data has x-axis values ranging 0-2500 growing days. I am looking for ggplot2 specific solution preferably. </p>