我有一组150x150px的png图像,以及它们对应的一组(x,y)坐标.有没有办法在网格上绘制图像?例如,我正在寻找一个R或Python解决方案来创建如下内容:

这是一个与这个广受欢迎的问题有关的问题。在该问题中,我看到了有关如何在散点图等不同坐标上绘制图像(或不同图像)的答案。
使用TextArea我可以将小字符串而不是图像放在不同的坐标处。
如果我想放置由matplotlib本身生成的绘图/图像的迷你版,该怎么办?假设我要使用散点图中的图像作为image.jpg结果,而不是使用I。plt.stem(arr)
我怎样才能做到这一点?微型版本的输出plt.plot(x, y)怎么样?
我试图将链接问题中给出的功能修改为:
def stem_scatter(x, y, arr, ax=None):
from matplotlib.offsetbox import AnnotationBbox, DrawingArea
if ax is None:
ax = plt.gca()
im = DrawingArea(0.1, 0.1)
im.add_artist(plt.stem(arr))
x, y = np.atleast_1d(x, y)
artists = []
for x0, y0 in zip(x, y):
ab = AnnotationBbox(im, (x0, y0), xycoords='data', frameon=False)
artists.append(ax.add_artist(ab))
ax.update_datalim(np.column_stack([x, y]))
ax.autoscale()
return artists
Run Code Online (Sandbox Code Playgroud)
但这给出了一个错误:
AttributeError: 'StemContainer' object has no attribute 'is_transform_set'
编辑:从链接的问题:
"…. but the second has a large …Run Code Online (Sandbox Code Playgroud) 我正在使用python 3.5.2我想制作一个png图像嵌入的饼图.我有一些我希望插入切片的批量产品的图片.例如,一片中的草莓和另一片中的覆盆子.很像图片http://www.python-course.eu/images/pie_chart_with_raspberries.png显示.
我可以生成图像甚至绘制图像而不是点,如此处所示Matplotlib:如何绘制图像而不是点?
但是,我找不到任何针对我提议的方法.我想它可以在油漆中手动完成,但我试图避免这种情况.