在图像上绘制对数图

Plotting log plot over image

我有需要在对数刻度上绘制的数据,我想在背景中绘制图像。请记住,图像应填满对数图的范围。问题是,将比例尺设置为记录时,图像会失真。该图像也以对数比例绘制(我认为)。我想我必须解耦两个轴,或类似的东西。我尝试了一些方法,但要么图像没有填满对数图的范围,要么图像失真。

这是我的原始代码:

plt.scatter(df['razao atrito'],df['resistencia'],zorder=2)
plt.xscale("log",nonposx="mask")
plt.xlim(0.1,10)
plt.yscale("log",nonposy="mask")
plt.ylim(1,1000)
img=plt.imread("Capture.jpg")
plt.imshow(img,aspect='auto',zorder=1,extent=[0.1,10,1,1000])

您应该在 imshow 中添加一个 transform=ax.transAxes 和一个 0-1 范围,以便它显示在轴坐标中。