title: Pandas legend for scatter matrix
body: <p>I have a pandas dataframe with 3 classes and datapoints of n features.</p>
  
  <p>The following code produces a scatter matrix with histograms in the diagonal, of 4 of the features in the dataframe.</p>
  
  <pre><code>colums = ['n1','n2','n3','n4']
  grr = pd.scatter_matrix(
  dataframe[columns], c=y_train, figsize=(15,15), label=['B','N','O'], marker='.',
      hist_kwds={'bins':20}, s=10, alpha=.8, cmap='brg')
  plt.legend()
  plt.show()
  </code></pre>
  
  <p>like this:</p>
  
  <p><a href="https://i.stack.imgur.com/XdfQI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XdfQI.png" alt="Scatter matrix of this dataframe"></a></p>
  
  <p>The problem I'm having is that plt.legend() doesn't seem to work, it shown no legend at all (or it's the tiny 'le8' barely visible in the first column of the second row...)</p>
  
  <p>What I'd like to have is a single legend that just shows which color is which class.</p>
  
  <p>I've tried all the suggested questions but none have a solution.
  I also tried to put the labels in the legend function parameters like this:</p>
  
  <pre><code>plt.legend(label=['B','N','O'], loc=1)
  </code></pre>
  
  <p>but to no avail..</p>
  
  <p>What am I doing wrong?</p>