title: Create part-fixed, part-free axis limits on facets with ggplot?
body: <p>I'd like to create a faceted plot using ggplot2 in which the minimum limit of the y axis will be fixed (say at 0) and the maximum limit will be determined by the data in the facet (as it is when <code>scales="free_y"</code>. I was hoping that something like the following would work, but no such luck:</p>
  
  <pre><code>library(plyr)
  library(ggplot2)
  
  #Create the underlying data
  l &lt;- gl(2, 10, 20, labels=letters[1:2])
  x &lt;- rep(1:10, 2)
  y &lt;- c(runif(10), runif(10)*100)
  df &lt;- data.frame(l=l, x=x, y=y)
  
  #Create a separate data frame to define axis limits
  dfLim &lt;- ddply(df, .(l), function(y) max(y$y))
  names(dfLim)[2] &lt;- "yMax"
  dfLim$yMin &lt;- 0
  
  #Create a plot that works, but has totally free scales
  p &lt;- ggplot(df, aes(x=x, y=y)) + geom_point() + facet_wrap(~l, scales="free_y") 
  #Add y limits defined by the limits dataframe
  p + ylim(dfLim$yMin, dfLim$yMax)
  </code></pre>
  
  <p>It's not too surprising to me that this throws an error (<code>length(lims) == 2 is not TRUE</code>) but I can't think of a strategy to get started on this problem.</p>