Scales = "free" works for facet_wrap but doesn't for facet_grid
<p>I'm trying to understand why the outputs of <code>facet_grid()</code> and <code>facet_wrap()</code> are different, even though the inputs are the same:</p>

<h3>facet_grid</h3>

<pre><code>ggplot(temp, aes(x = valor)) +
geom_histogram(binwidth = 5, fill = NA, color = "black") +
facet_grid(estratificacao ~ referencia, scales = "free") +
scale_x_continuous(breaks = seq(0, 100, 10)) + theme_classic()
</code></pre>

<p><a href="https://i.stack.imgur.com/6FLTg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6FLTg.png" alt="enter image description here"></a></p>

<h3>facet_wrap</h3>

<pre><code>ggplot(temp, aes(x = valor)) +
geom_histogram(binwidth = 5, fill = NA, color = "black") +
facet_wrap(estratificacao ~ referencia, scales = "free") +
scale_x_continuous(breaks = seq(0, 100, 10)) + theme_classic()
</code></pre>

<p><a href="https://i.stack.imgur.com/om5Vk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/om5Vk.png" alt="enter image description here"></a></p>

<p>See, the argument <code>scales = "free"</code> does not have the same behaviors for <code>facet_grid()</code> and <code>facet_wrap()</code>. What can explain that?</p>