更新时间:2022-06-22 01:42:39
实际上,它工作正常。我很困惑。
Actually, it works fine. I'm confused.
以前我收到的错误是非线性轴上不支持图像这就是我问这个问题的原因。但现在当我尝试它时,它可以工作:
Previously I was getting errors about "Images are not supported on non-linear axes" which is why I asked this question. But now when I try it, it works:
import matplotlib.pyplot as plt
import numpy as np
x = np.logspace(1, 3, 5)
y = np.linspace(0, 2, 3)
z = np.linspace(0, 1, 4)
Z = np.vstack((z, z))
plt.imshow(Z, extent=[10, 1000, 0, 1], cmap='gray')
plt.xscale('log')
plt.axvline(100, color='red')
plt.show()
这比 pcolor()
和 pcolormesh()因为
This is better than pcolor()
and pcolormesh()
because