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()
图像正在播放中