I'm plotting a scatter plot of attributes of faces of people, and instead of a point marker, would like to use a little icon of the person's face as a point on the plot. From a related thread from many years ago, it's been shown how to do this in part:
Adding a small photo/image to a large graph in Matplotlib/Python
However, this thread does not make mention of how to specify the icon coordinates in terms of x and y values of the plot. Given that I have the X, Y values corresponding to the datapoints at which I want to center the icons of faces, how can I adapt this example? Here is the accepted answer from that thread:
import matplotlib, scipy
fig = matplotlib.figure()
ax = fig.add_axes([0.1,0.1,0.8,0.8])
axicon = fig.add_axes([0.4,0.4,0.1,0.1])
ax.plot(range(5), [4,2,3,5,1])
axicon.imshow(scipy.randn(100,100))
axicon.set_xticks([])
axicon.set_yticks([])
fig.show()
The line that throws me off is:
axicon = fig.add_axes([0.4,0.4,0.1,0.1])
How do I translate this to x,y values on the plot?