title: Matplotlib multiple scatter plot picker
body: <p>I am trying to follow <a href="https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html" rel="nofollow noreferrer">this demo</a> on handling pick events on scatter plots. The demo works for a single scatter plot. However, when I add a second scatter plot, I only get indices of one of the plots upon clicking on the points. This is my code:</p>
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  from numpy.random import rand
  
  def pick_scatter_plot():
      # picking on a scatter plot (matplotlib.collections.RegularPolyCollection)
  
      x, y, c, s = rand(4, 2)
  
      def onpick3(event):
          ind = event.ind
          print('onpick3 scatter:', ind, x[ind], y[ind])
  
      fig, ax = plt.subplots()
      #first scatter plot:
      ax.scatter(x, y, 100, c, marker='o', picker=True)
      #second scatted plot
      ax.scatter(x*2, y, 50, c, marker='s', picker=True)  
      fig.canvas.mpl_connect('pick_event', onpick3)    
  
  if __name__ == '__main__':
      pick_scatter_plot()
      plt.show()  
  </code></pre>
  <p>The first set is plotted with the marker 'o', the second set is plotted with the marker 's' like this:</p>
  <p><a href="https://i.stack.imgur.com/ALz9m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ALz9m.png" alt="enter image description here" /></a></p>
  <p>However, when I click on all four points, I only get indices of 0 and 1. This is the output when I click all 4 points one by one:</p>
  <pre><code>('onpick3 scatter:', array([1], dtype=int32), array([0.18243891]), array([0.30505569]))
  ('onpick3 scatter:', array([1], dtype=int32), array([0.18243891]), array([0.30505569]))
  ('onpick3 scatter:', array([0], dtype=int32), array([0.35977978]), array([0.66748979]))
  ('onpick3 scatter:', array([0], dtype=int32), array([0.35977978]), array([0.66748979]))
  </code></pre>
  <p>My question is how to access the indices of the points of both scatter plots properly? Combining all the data into a single scatter plot would not work for me because I have multiple sets I need to plot with different markers and <code>scatter</code> does not allow for a list of markers.</p>