code: def onpick(self, event):
          
          if hasattr(event.artist, '_mt_legend_item'):
              # legend item, instead of data point
              idx = event.artist._mt_legend_item
              try:
                  self.toggle_artist(self.artists[idx])
              except IndexError:
                  pass
              return
  
          # only print logevents of visible points
          if not event.artist.get_visible():
              return
  
          # get PlotType and let it print that event
          plot_type = event.artist._mt_plot_type
          plot_type.clicked(event)
docs: Called per artist (group), with possibly a list of indices.