title: Generate custom legend with multiple scatter markers by label with different colors
body: <p>I'm working in generating some scatter plots in which I would like to group different scatter symbols that share the same variable into a single legend entry. I have seen that, in theory, I should create an artist with mpatches and use that artist as the handle for the legend. However, I don't seem to find how to create artist objects with multiple scatter symbols specifying the position and color of each object so that they do not overlap. The final legend would be something like this, in which there are 6 scatter points by legend entry divided in 2 rows and 3 columns:
  <a href="https://i.stack.imgur.com/nntvm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nntvm.png" alt="enter image description here" /></a></p>
  <p>The plotting code that I'm using is the following:</p>
  <pre><code>fig=plt.figure(figsize=(4.60,2.58))
  ax = fig.add_subplot()
  for x,y,c,e in zip(x1,y1,c1,e1):
      ax.scatter(x,y,c=c, marker='o', s=30)
      ax.errorbar(x, y, yerr=e,capsize=2, fmt=&quot;none&quot;, c=&quot;black&quot;, elinewidth=1)
  for x,y,c,e in zip(x2,y2,c2,e1):
      ax.scatter(x,y,c=c, marker='o', s=30)
      ax.errorbar(x, y, yerr=e, capsize=2,fmt=&quot;none&quot;, c=&quot;black&quot;,elinewidth=1)
  
  ax.set_xlim(0.5,6.5)
  ax.set_ylim(1.15,1.32)
  #ax.scatter(-10,-10, c=&quot;#558e7d&quot;,label=&quot;IPHTAPDO MDI&quot;)
  #ax.scatter(-10,-10, c=&quot;#cd6241&quot;,label=&quot;IPHTAHDO MDI&quot;)
  xlist=[&quot;1000 10%&quot;, &quot;1000 30%&quot;, &quot;1000 50%&quot;, &quot;2000 10%&quot;, &quot;2000 30%&quot;, &quot;2000 50%&quot;]
  ax.set_xticklabels(xlist, rotation=90)
  ax.set_xticks((1,2,3,4,5,6))
  ax.tick_params(axis='both', labelsize=9)
  
  ax.set_ylabel(&quot;Density (g/mL)&quot;,fontsize=9)
  ax.set_xlabel(&quot;Polyester Mn, HS (mol%)&quot;,fontsize=9, labelpad=10)
  
  
  
  ax.legend(fontsize=9,loc=&quot;upper left&quot;, bbox_to_anchor=(1,1.045))
  
  plt.subplots_adjust(left=0.140, right=0.675, top=0.970, bottom=0.410)
  plt.show()
  </code></pre>