title: ggplot2 error - 'Discrete value supplied to continuous scale'
body: <p>I'm trying to plot filled rectangles using the following code -</p>
  <pre><code>tplot.old &lt;- ggplot() + 
  geom_rect(data=t.df,mapping=aes(xmin=xa, xmax=xb, ymin=ya, ymax=yb, fill=Train)) +
  ylab(&quot;Cars per week&quot;) + xlab(&quot;Miles&quot;) + ggtitle(old.title) +
  theme(axis.text.x = element_text(angle=45,size=5,hjust=1), axis.text=element_text(size=5), axis.text.y = element_text(size=5), title=element_text(size=5), legend.text=element_text(size=5)) + 
  scale_fill_manual(values=color_values) + 
  scale_x_continuous(breaks=plot.stns$Avg_Miles,labels=plot.stns[,&quot;City_Name&quot;]) + 
  coord_cartesian(xlim=c(0,1700),ylim=c(0,500))
  </code></pre>
  <p><code>t.df</code> looks like this:</p>
  <pre><code>   Train  xa   xb ya        yb       col
  a  MHKNP 407 1594  0 22.806452       red
  b  MPDNP 407 1594  0  9.258065 darkgreen
  cd MHKRO 407 1594  0  5.258065    orange
  </code></pre>
  <p>and <code>plot.stns</code>:</p>
  <pre><code>      Avg_Miles       City_Name
  1           0          EUGENE
  4          15    BLAKESLEEJCT
  12         64     LONGVIEWJCT
  25        118          ALBINA
  45        306          HINKLE
  </code></pre>
  <p>This seems to work when I plot this interactively on the console, but inside a for loop gives this error -</p>
  <blockquote>
  <p>Error: Discrete value supplied to continuous scale</p>
  </blockquote>
  <p>color_values :</p>
  <pre><code>     MHKNP      MHKNPB       MHKPC       MHKRO       MPCGR       MPSHK 
       &quot;red&quot;     &quot;green&quot;      &quot;blue&quot;    &quot;maroon&quot;    &quot;orange&quot;     &quot;black&quot; 
       QCONP      QPCNPP       MPDNP 
     &quot;magenta&quot;   &quot;skyblue&quot; &quot;darkgreen&quot; 
  </code></pre>
  <p>This is somehow related to <code>scale_x_continuous</code> (it does not give the error when I remove it), but I can't figure out what is wrong here. Any ideas?</p>