title: Use free_y scale on first axis and fixed on second + facet_grid + ggplot2
body: <p>Is there any method to set <code>scale = 'free_y'</code> on the left hand (first) axis in ggplot2 and use a fixed axis on the right hand (second) axis?</p>
  <p>I have a dataset where I need to use free scales for one variable and fixed for another but represent both on the same plot. To do so I'm trying to add a second, fixed, y-axis to my data. The problem is I cannot find any method to set a fixed scale for the 2nd axis and have that reflected in the facet grid.</p>
  <p>This is the code I have so far to create the graph -</p>
  <pre><code>#plot weekly seizure date 
  p &lt;- ggplot(dfspw_all, aes(x=WkYr, y=Seizures, group = 1)) +  geom_line() + 
    xlab(&quot;Week Under Observation&quot;) + ggtitle(&quot;Average Seizures per Week - To Date&quot;) + 
    geom_line(data = dfsl_all, aes(x =WkYr, y = Sleep), color = 'green') +
    scale_y_continuous(
      # Features of the first axis
      name = &quot;Seizures&quot;,
      # Add a second axis and specify its features
      sec.axis = sec_axis(~.[0:20], name=&quot;Sleep&quot;)
    )
  
  p + facet_grid(vars(Name), scales = &quot;free_y&quot;) +
    theme(axis.ticks.x=element_blank(),axis.text.x = element_blank())
  </code></pre>
  <p>This is what it is producing (some details omitted from code for simplicity) -</p>
  <p><a href="https://i.stack.imgur.com/HdpAr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HdpAr.png" alt="enter image description here" /></a></p>
  <p>What I need is for the scale on the left to remain &quot;free&quot; and the scale on the right to range from 0-24.</p>