当 X 轴值范围为 43990 - 44003 时,为什么我的 X 轴刻度显示负值。
import matplotlib.pyplot as plt
x=[44000, 44001, 44002, 44003, 43990, 43991, 43992, 43993, 43994, 43995, 43996, 43997, 43998, 43999]
y=[8, 5, 3, 1, 1, 3, 4, 10, 4, 11, 4, 10, 17, 19]
plt.bar(x,y)
plt.show()
I am seeing the following output. I was expecting x-axis to range from 43990 - 44003
![why negative x-axis ticks ?](https://i.stack.imgur.com/dQ55X.png)
我已经在几台机器上尝试过了,所有机器在最新版本的 python 和 matplotlib 上都显示出类似的奇怪行为(尝试了几个不同的版本)
Python 3.6.4 |Anaconda 公司| (默认,2018 年 1 月 16 日 18:10:19)
Linux 上的 [GCC 7.2.0]
Python 3.4.3(默认,2016 年 11 月 17 日,01:08:31)
奇怪的是,许多简单的玩具示例 x 和 y 数组都给了我预期的数字。
例如,以下代码片段显示了带有正确 x 轴刻度标签的预期图表
x=[20,30,90,70, 50, 60, 80, 70]
y=[3,2,5,10, 3, 9, 7, 6]
plt.bar(x,y)
plt.show()
我在这里缺少什么明显的东西?