title: How to get distinct label name for each scatter points in graph using matplotlib in python?
body: <p>I am using a for loop for giving labels &amp; color to points. But I am not getting a unique label for each different color symbol, instead, I am getting a long queue at the top of my graph due to large excel data of 500 or so rows.
  Here is my code:</p>
  <pre><code>for val in ghi:
  if val &lt; 2:
      col.append('navy')
      lab.append(' &lt;2 ')
  elif (val &gt;= 2) and (val &lt; 4):
      col.append('lightblue')
      lab.append(' 2~4 ')
  elif (val &gt;= 4) and (val &lt; 6):
      col.append('orange')
      lab.append(' 4~6 ')
  else:
      col.append('brown')
      lab.append(' &gt;6 ')
  plt.scatter(x, y, marker = &quot;D&quot;, s = 10, color = col, label = lab)
  sns.lineplot(x, y, color =&quot;red&quot;)
  plt.legend()
  </code></pre>