title: Overlayed seaborn distplots sharing x axis
body: <p>sorry if this is too basic, this is my first question to the forum:</p>
  <p>I'm using the titanic dataset for practice and</p>
  <p>I'm trying to plot two distributions of the variable 'Age', one only with passengers that survived and another with the passenger that perished. But for some reason, they don't share the same x-axis when plotted together.</p>
  <p>Here's my code so far:</p>
  <pre><code>df_age = df[df['Age'].notnull()]
  dfage_survived = dfage[dfage.Survived == 1] 
  dfage_perished = dfage[dfage.Survived == 0] 
  
  sns.set(style=&quot;white&quot;, palette=&quot;muted&quot;, color_codes=True)
  fig = plt.figure(constrained_layout=True, figsize=(8, 8))
  spec = fig.add_gridspec(3, 2)
  
  ax1 = fig.add_subplot(spec[0, 0])
  ax1 = sns.barplot(x='Sex', y = 'Survived', data =df)
  ax2 = fig.add_subplot(spec[0, 1])
  ax2 = sns.barplot(x='Embarked', y = 'Survived', data =df)
  ax3 = fig.add_subplot(spec[1, 0])
  ax3 = sns.barplot(x='Pclass', y ='Survived', data =df)
  ax4 = fig.add_subplot(spec[1, 1])
  ax4 = sns.barplot(x='SibSp', y ='Survived', data=df)
  ax5 = fig.add_subplot(spec[2, :])
  ax5_1 = sns.distplot(dfage_survived['Age'], kde = False, label = 'Survived')
  ax5_2 = sns.distplot(dfage_perished['Age'], kde = False, label = 'Perished')
  plt.legend(prop={'size': 12})
  </code></pre>
  <p>OUTPUT:
  <a href="https://i.stack.imgur.com/Mgej0.png" rel="nofollow noreferrer">OUTPUT:</a></p>