I have a series of small, fixed width images and I want to replace the tick labels with them. For example, consider the following minimal working example:
import numpy as np
import pylab as plt
A = np.random.random(size=(5,5))
fig, ax = plt.subplots(1, 1)
ax.matshow(A)
plt.show()
I would like to replace the "0" with a custom image. I can turn off the labels, load an image into an array and display it just fine. However, I'm unsure of
- Where the locations of the tick labels are, since they lie outside the plot.
- Use
imshow
to display that image when it it will be "clipped" if put into an axis.
My thought were to use set_clip_on
somehow or a custom artist, but I haven't made much progress.