title: Modify overlapping geom_boxplot width to span entire x range used for calculations
body: <p>I would like to create a ggplot graph, where boxplots are on the same graph as the points used for their calculation.  </p>
  
  <p>The points are count data, and the goal of the boxplot is to show how the distribution of those points change when different timeframes from present are used for their calculation.  I would like to get it so all boxplots have their right side edge aligned with the last date, and have a width that extends the left hand side of boxplot to the first year considered.  </p>
  
  <p>I have included the data to plot below.  I have attempted to include <code>varwidth=T</code>, but specifying width in aesthetics is not recognized as either a variable or static number, and has no effect outside the aesthetics. </p>
  
  <p>Any advice on if this is possible and how to achieve would be appreciated.</p>
  
  <pre><code>library(ggplot2)
  library(dplyr)
  library(tidyr)
  
  CUTS &lt;- structure(list(`Years to Consider` = c(3, 5, 9, 18, 27), 
      Year = c(2014,2012, 2008, 1999, 1990)), 
      row.names = c(NA, -5L), class = "data.frame")  
  
  data &lt;- structure(list(
    Year = c(1978, 1979, 1980, 1982, 1983, 1984, 1985,1986, 1987, 1988, 
             1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997,1998, 1999, 
             2000, 2001, 2002, 2003, 2007, 2009, 2010, 2012, 2014,2017),
    Total = c(110, 262, 240, 711, 710, 775, 985, 929, 933,670, 1162, 
              1215, 1408, 1194, 1136, 1321, 1327, 1689, 2121, 1754, 
              2167, 2051, 2862, 2861, 1784, 2093, 1367, 1003, 685, 451), 
    Lambda = c(NA, 2.38181818181818, 0.916030534351145, 1.72119144780585, 
               0.9985935302391, 1.09154929577465, 1.27096774193548, 
               0.943147208121827, 1.0043057050592, 0.718113612004287, 
               1.73432835820896, 1.04561101549053, 1.15884773662551,
               0.848011363636364, 0.975409547623274, 1.16285211267606, 
               1.00454201362604,1.27279577995479, 1.25577264653641, 
               0.826968411126827, 1.23546180159635,0.946469773880941, 
               1.3954168698196, 0.999650593990217, 0.888626474900967,
               1.08314647117872, 0.653129479216436, 0.856576606076504, 
               0.826408583305086,0.869952065260471)), 
    class = "data.frame", row.names = c(NA,-30L))
  
  ####data for entire period
  BOX_DATA &lt;-data %&gt;%  mutate(LAMB_YEARS=last(Year)-first(Year), FIRST_YEAR=first(Year))
  
  ###select all data with year greater than cutoffs in CUTS data frame up to last year, 
  ###assign variable for number of years conisdered, bind to enitre period
  for(i in CUTS$Year){
    temp_box &lt;- data %&gt;% filter(Year&gt;=i) %&gt;% select(Year, Total,Lambda) %&gt;% 
      mutate(LAMB_YEARS=2017-i, FIRST_YEAR=i)
    BOX_DATA &lt;- rbind(BOX_DATA, temp_box)      
  }
  ####make lamb years factor for boxplot grouping define order so largest draw on bottom
  BOX_DATA$LAMB_YEARS &lt;- factor(BOX_DATA$LAMB_YEARS, levels=c(39,27,18,9,5,3))
  
  ####make graph
  ggplot(data, aes(Year, Lambda)) + 
     geom_point() + 
     geom_boxplot(data=BOX_DATA, aes(fill=LAMB_YEARS), alpha=.3)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yOSUs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yOSUs.png" alt="enter image description here"></a></p>