getting scatter x-data?

When I draw a Line2D instance (using plot()), I have set up an interactive way of clicking on one of the points to return the x-coordinate of the point. There might be a simpler way to do it, but the way I figured out is:

def on_pick(self, event): # called when clicking on a Line2D point
return [event.artist.get_xdata()[pt].data[0] for pt in event.artist.contains(event.mouseevent)[1].values()]

my basic interpretation is that I get the point index in the line and then get the xcoord for that point.

It would be nice to get the xcoord for a scatter point as well, but I haven’t had luck figuring that one out. I can do event.artist.contains(event.mouseevent) to get the index for the scatterpoint, but apparently there’s no get_xdata() tied to the regularpolygon instance.

paul