title: How to sync Colors across Subplots of different types Seaborne / Matplotlib
body: <p>I am trying to create a subplot with two plots. The first plot is essentially a scatter plot (i'm using regplot) and the second is a histogram. </p>
  
  <p>my code is as follows:</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  import seaborn as sns
  
  data = {'source':['B1','B1','B1','C2','C2','C2'],
          'depth':[1,4,9,1,3,10],
          'value':[10,4,23,78,24,45]}
  
  df = pd.DataFrame(data)
  
  f, (ax1, ax2) = plt.subplots(1,2)
  
  for source in df['source'].unique():
  
      x = df.loc[df['source'] == source, 'value']
      y = df.loc[df['source'] == source, 'depth']
  
      sns.regplot(x,
                  y,
                  scatter = True,
                  fit_reg = False,
                  label = source,
                  ax = ax1)
      ax1.legend()
  
      sns.distplot(x,
                   bins = 'auto',
                   norm_hist =True,
                   kde = True,
                   rug = True,
                   ax = ax2,
                   label = source)
      ax2.legend()
      ax2.relim()
      ax2.autoscale_view()
  plt.show()
  </code></pre>
  
  <p>The result is shown below. </p>
  
  <p><a href="https://i.stack.imgur.com/CxpFR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CxpFR.png" alt="enter image description here"></a></p>
  
  <p>As you can see, the colors between the scatter and the histogram are different. Now, I had a play around with color pallets and all, which has not worked. Can anyone shed any light on how I can sync the colors?</p>
  
  <p>Thanks.</p>