title: How to remove gap at end of ggplot2 graph
body: <p>My input file is <a href="http://pastebin.com/CXneq6yc" rel="nofollow noreferrer">here on PasteBin</a>.</p>
  
  <p>My current graph code is:</p>
  
  <pre><code> #Input and data formatting
   merg_agg_creek&lt;-read.table("merged aggregated creek.txt",header=TRUE)
   library(ggplot2)
   library(grid)
   source("http://egret.psychol.cam.ac.uk/statistics/R/extensions/rnc_ggplot2_border_themes.r")
  
   CombinedCreek&lt;-data.frame(merg_agg_creek)
   Combined&lt;-CombinedCreek[order(CombinedCreek[,2]),]
   Combined$Creek &lt;- factor(rep(c('Culvert Creek','North Silcox','South Silcox','Yucca Pen'),c(32,57,51,31)))  
   Combined$Creek&lt;-factor(Combined$Creek,levels(Combined$Creek)[c(1,4,3,2)])
  
   #The Graph Code
  
   creek &lt;-ggplot(Combined,aes(Month,Density,color=factor(Year),shape=factor(Year)))+scale_color_discrete("Year")+scale_shape_discrete("Year")
   creek&lt;-creek + facet_grid(Creek~. ,scales = "free_y")
   creek &lt;- creek + geom_jitter(position = position_jitter(width = .3))
   creek&lt;-creek+scale_color_grey("Year",end=.6)+theme_bw()
   creek&lt;-creek+scale_y_continuous(expression("Number of prey captured " (m^2) ^-1))
   creek&lt;-creek+opts( panel.border = theme_L_border() )+ opts(axis.line = theme_segment())
   creek&lt;-creek+opts(panel.grid.minor = theme_blank())+opts(panel.grid.major = theme_blank())
   creek&lt;-creek+scale_x_discrete("Month",breaks=c(2,5,8,11),labels=c("February","May","August","November"))
   creek
  </code></pre>
  
  <p>The resulting graph is: 
  <a href="https://imgur.com/X6KST" rel="nofollow noreferrer">Graph</a><br>
  <img src="https://i.imgur.com/X6KST.png" alt="graph"></p>
  
  <p>My issue is that by creating the breaks and labels in "scale_x_discrete", a large gap exists on the righthand side of the plot, between the data in December and the facet labels.  I tried eliminating this gap by adding "limits=c(0,13)" to the "scale_x_discrete: command, but the <a href="https://imgur.com/oIURF" rel="nofollow noreferrer">resulting graph</a> destroys the x-labels.</p>
  
  <p>How do I remove that gap?  Is there something fundamentally flawed in my plot creation?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT:  Didzis answered the question below.  I just need to change from scale_x_discrete to scale_x_continuous</p>