Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 线型图无法看到x轴标签_Python_Pandas - Fatal编程技术网

Python 线型图无法看到x轴标签

Python 线型图无法看到x轴标签,python,pandas,Python,Pandas,我正在测试一个非常简单的练习,只需绘制以下代码: t = pd.Series([1,2,5,1,8], index=['a', 's', 'l', 'f', 'd' ]) t.plot(linestyle = '-', color = 'b', sharex = True) 但是我看不到字母a,s,l,f和d 有什么建议吗?你可以这样做: 将熊猫作为pd导入 从matplotlib导入pyplot作为plt t=pd.系列([1,2,5,1,8],索引=['a','s','l','f','d'

我正在测试一个非常简单的练习,只需绘制以下代码:

t = pd.Series([1,2,5,1,8], index=['a', 's', 'l', 'f', 'd' ])
t.plot(linestyle = '-', color = 'b', sharex = True)
但是我看不到字母
a
s
l
f
d

有什么建议吗?

你可以这样做:

将熊猫作为pd导入
从matplotlib导入pyplot作为plt
t=pd.系列([1,2,5,1,8],索引=['a','s','l','f','d'])
plt.plot(t.index,t.values,linestyle='-',color='b')
plt.show()
图像正在播放中

你可以这样做:

将熊猫作为pd导入
从matplotlib导入pyplot作为plt
t=pd.系列([1,2,5,1,8],索引=['a','s','l','f','d'])
plt.plot(t.index,t.values,linestyle='-',color='b')
plt.show()
图像正在播放中