title: Matplotlib stacked histogram using `scatter_matrix` on pandas dataframe
body: <p>Currently I have the following code</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import pandas as pd
  from pandas.plotting import scatter_matrix
  
  df= pd.read_csv(file, sep=',')
  colors = list('r' if i==1 else 'b' for i in df['class']) # class is either 1 or 0
  plt.figure()
  scatter_matrix(df, color=colors )
  plt.show()
  </code></pre>
  
  <p>It shows the following output</p>
  
  <p><a href="https://i.stack.imgur.com/OXX3F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OXX3F.png" alt="enter image description here"></a></p>
  
  <p>But in this plot on diagonals, instead of simple histogram I want to show stacked histogram like the following such that for class '1' it is red and for '0' it is blue</p>
  
  <p><a href="https://i.stack.imgur.com/Uerht.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uerht.png" alt="enter image description here"></a></p>
  
  <p>Please guide me how can I do this ?</p>