【问题标题】:Plotting log plot over image在图像上绘制日志图
【发布时间】:2019-09-24 13:14:24
【问题描述】:

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

这是我的原始代码:

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])

【问题讨论】:

    标签: python matplotlib plot scale imshow


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-01
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      • 2017-07-05
      • 2012-11-24
      相关资源
      最近更新 更多