title: matplotlib does not show legend in scatter plot
body: <p>I am trying to work on a clustering problem for which I need to plot a scatter plot for my clusters.</p>
  
  <pre><code>%matplotlib inline
  import matplotlib.pyplot as plt
  df = pd.merge(dataframe,actual_cluster)
  plt.scatter(df['x'], df['y'], c=df['cluster'])
  plt.legend()
  plt.show()
  </code></pre>
  
  <blockquote>
    <p>df['cluster'] is the actual cluster number. So I want that to be my color code.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/pLqDt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pLqDt.png" alt="enter image description here"></a></p>
  
  <p>It shows me a plot but it does not show me the legend. it does not give me error as well.</p>
  
  <p>Am I doing something wrong?</p>