Assuming that you are not drawing a lot of scatter points, you can simply do scatterfor each point:
import numpy as np; import matplotlib.pyplot as plt
y = np.arange(10)
x=np.arange(10)
labels = np.arange(10)
fig, ax = plt.subplots(nrows=1, ncols=1)
for x_,y_,label in zip(x,y,labels):
ax.scatter([x_], [y_], label=label, picker=3)
, , , .
, ax.get_children() , , :
[<matplotlib.axis.XAxis at 0x103acc410>,
<matplotlib.axis.YAxis at 0x103acddd0>,
<matplotlib.collections.PathCollection at 0x10308ba10>, #<--- this is a set of scatter points
<matplotlib.text.Text at 0x103082d50>,
<matplotlib.patches.Rectangle at 0x103082dd0>,
<matplotlib.spines.Spine at 0x103acc2d0>,
<matplotlib.spines.Spine at 0x103ac9f90>,
<matplotlib.spines.Spine at 0x103acc150>,
<matplotlib.spines.Spine at 0x103ac9dd0>]
, - ax.collections. list, collections, ( PathCollection).
In [9]: ax.collections
Out[9]: [<matplotlib.collections.PathCollection at 0x10308ba10>]
scatter , , :
for point in ax.collections:
point.set_facecolor("red")