title: How to easily maintain the same axis scale for two histograms
body: <p>Saw some similar code, but I was curious if this was possible with the "gridExtra" package. I want to show these on the same scale of the x and the y axis. Need to do this for boxplots as well. Is there an easier way to do this with grid.arrange()?</p>
  
  <p><a href="https://i.stack.imgur.com/giBdv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/giBdv.png" alt="enter image description here"></a></p>
  
  <pre><code>library(tidyverse)
  library(gridExtra)
  
  #Subset of Data
  za &lt;- structure(list(sodium = c(1.77, 1.79, 1.63, 1.61, 1.64, 1.65, 
  1.58, 1.75, 1.71, 1.66), cal = c(4.93, 4.84, 4.95, 4.74, 4.67, 
  4.67, 4.63, 4.72, 4.93, 4.95)), class = c("tbl_df", "tbl", "data.frame"
  ), row.names = c(NA, -10L))
  
  #Histogram
  sodHist &lt;- ggplot(data = za, mapping = aes(x = sodium)) +
    geom_histogram(fill = "royalblue1", color = "white") +
    ggtitle("Sodium Distribution of Pizzas")
  
  calHist &lt;- ggplot(data = za, mapping = aes(x = cal)) +
    geom_histogram(fill = "limegreen", color = "white") +
    ggtitle("Calorie Distribution of Pizzas")
  
  grid.arrange(sodHist,calHist, ncol = 2)
  </code></pre>