这与以所计算出的显示区域(轴极限)有关
matplotlib。
通过使用
set_xlim和
set_ylim方法手动编辑轴范围可以解决此问题。
plt.figure()plt.scatter(X, Y)plt.yscale('log')plt.xscale('log')axes = plt.gca()axes.set_xlim([min(X),max(X)])axes.set_ylim([min(Y),max(Y)])plt.show()但是,我尚未找出这种行为的确切原因。欢迎提出建议。
编辑
如评论部分所述,显然Matplotlib已将Autoscaling视为根本问题,作为其官方Github存储库上的_发行关键问题_ ,该问题将在以后的版本中修复。谢谢。



