我的python绘图数据仅显示x轴上的2个点.
我想要更多,但不知道如何.
x = [ datetime.datetime(1900,1,1,0,1,2),
datetime.datetime(1900,1,1,0,1,3),
...
] # ( more than 1000 elements )
y = [ 34, 33, 23, ............ ]
plt.plot( x, y )
Run Code Online (Sandbox Code Playgroud)
X轴仅显示2个间隔点.我尝试使用.xticks但不适用于X轴.它给出了以下错误:
TypeError: object of type 'datetime.datetime' has no len()
Run Code Online (Sandbox Code Playgroud)