title: How can I add grid lines to a catplot in seaborn?
body: <p>How can I add grid lines (vertically and horizontally) to a <code>seaborn</code> catplot? I found a possibility to do that on a boxplot, but I have multiple facets and therefore need a catplot instead. And in contrast to this other answer, catplot does not allow an <code>ax</code> argument. </p>
  
  <p>This code is borrowed from <a href="https://seaborn.pydata.org/generated/seaborn.catplot.html" rel="noreferrer">here</a>.</p>
  
  <pre class="lang-py prettyprint-override"><code>import seaborn as sns
  sns.set(style="ticks")
  exercise = sns.load_dataset("exercise")
  g = sns.catplot(x="time", y="pulse", hue="kind", data=exercise)
  plt.show()
  </code></pre>
  
  <p>Any ideas? Thank you!</p>
  
  <p>EDIT: The provided answer is working, but for faceted plots, only the last plot inherits the grid. </p>
  
  <pre class="lang-py prettyprint-override"><code>import seaborn as sns
  sns.set(style="ticks")
  exercise = sns.load_dataset("exercise")
  g = sns.catplot(x="time", y="pulse", hue="kind", col="diet", data=exercise)
  plt.grid()
  plt.show()
  </code></pre>
  
  <p>Can someone explain to me why and how to fix it?</p>