title: How to change the marker in a stripplot legend in seaborn
body: <p>The legend of a seaborn stripplot only shows the colored circles, however, the marker shapes are not respecting the marker that I set.</p>
  <p>Code for reproduction:</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import numpy as np
  import seaborn as sns
  import matplotlib.pyplot as plt
  
  letters = list('abcdefghijklmnopqrstuvwxyz')
  place = ['North', 'South', 'East', 'West']
  
  letter_set1 = set(&quot;abcdefghijklmn&quot;)
  letter_set2 = set(&quot;opqrstuvwxyz&quot;)
  
  data_size = 100
  
  df_dict = {'letter': np.random.choice(letters, data_size), 
             'place': np.random.choice(place, data_size),
             &quot;height&quot;: np.random.randint(low=40, high=100, size=data_size),
            &quot;weight&quot;: np.random.randint(low=150, high=210, size=data_size),}
  
  df = pd.DataFrame(df_dict)
  print(df)
  
  fig, ax = plt.subplots(1, 1, figsize=(10, 7))
  
  # We can ignore the violinplot
  sns.violinplot(x='place', y=&quot;weight&quot;, data=df, scale=&quot;width&quot;, inner=&quot;quartile&quot;, bw=0.2, linewidth=1,
  )
  for violin in ax.collections:
      violin.set_alpha(0.1)
  
  set1_df = df[df['letter'].isin(letter_set1)]
  set2_df = df[df['letter'].isin(letter_set2)]
  
  sns.stripplot(data=set1_df, x='place', y=&quot;weight&quot;, hue=&quot;letter&quot;, palette=&quot;Set1&quot;, size=10, linewidth=0.05, marker='^', ax=ax
  )
  sns.stripplot(data=set2_df, x='place', y=&quot;weight&quot;, hue=&quot;letter&quot;, palette=&quot;Set2&quot;, size=10, linewidth=0.05, marker='D', ax=ax
  )
  
  # Update the legend oreder
  handles, labels = ax.get_legend_handles_labels()
  zipped_list = zip(handles, labels)
  sorted_zipped_list = sorted(zipped_list, key=lambda x: x[1])
  ordered_handles, ordered_labels = [x[0] for x in sorted_zipped_list], [x[1] for x in sorted_zipped_list]
  
  ax.legend(
      handles=ordered_handles,
      labels=ordered_labels,
      title=&quot;Letter&quot;,
      bbox_to_anchor=(1.02, 1),
      loc=&quot;upper left&quot;,
      )
  plt.tight_layout()
  
  plt.show()
  plt.close()
  </code></pre>
  <p>Figure output:
  <a href="https://i.stack.imgur.com/oihjw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oihjw.png" alt="output" /></a></p>
  <p><strong>Goal: change the colored circles in the legend to diamonds and triangles.</strong></p>
  <p>The legend handles are all <code>matplotlib.collections.PathCollection</code> objects, which do not have obvious way to change. I also found an open issue on GitHub: <a href="https://github.com/mwaskom/seaborn/issues/940" rel="nofollow noreferrer">https://github.com/mwaskom/seaborn/issues/940</a> (for reference).</p>
  <p>Does anyone have idea on how to manually set the markers in the legend or some other quick ways to do it?</p>