title: Getting error: No handles with labels found to put in legend. when moving legend outside of the box when plotting with kdeplot with searborn
body: <p>I am plotting a kde plot using the seaborn kdeplot.</p>
  <pre><code>time_window_order=['272','268','264','260','256','252','248','244','240']
  order_dict = {k:i for i,k in enumerate(time_window_order)}
  df =DataFrame ({'time_window':['268','268','268','264','252','252','252','240',
                                 '256','256','256','256','252','252','252','240'],
                  'seq_no':['a','a','a','a','a','a','a','a',
                            'b','b','b','b','b','b','b','b']})
  df['centre_point'] = df['time_window'].map(order_dict)
  
  g =sns.kdeplot(data=df, x=&quot;centre_point&quot;,hue='seq_no', bw_adjust=0.8);plt.xlim(0,len(time_window_order)-1);plt.grid()
  g.legend(loc='center left', bbox_to_anchor=(1, 0.5)) # move legend outside the box
  plt.xticks(ticks = range(0,len(time_window_order)) ,labels = time_window_order, rotation = 'vertical')
  plt.show()
  </code></pre>
  <p>I tried reposition the <code>legend</code> outside the box using the line <code>g.legend(loc='center left', bbox_to_anchor=(1, 0.5))</code><a href="https://stackoverflow.com/a/64573338/6446053"> [link]</a>.</p>
  <p>Instead, the compiler return an error</p>
  <blockquote>
  <p>No handles with labels found to put in legend.</p>
  </blockquote>
  <p>Also, instead of complete legend, the legend appear to become like a small rectangle as shown by the red arrow, in the figure below.
  <a href="https://i.stack.imgur.com/UKibM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UKibM.png" alt="enter image description here" /></a></p>
  <p>May I know how to fix this?</p>