我有以下清单:
[('und', 52),
('die', 36),
('von', 33),
('der', 29),
('in', 20),
('das', 17),
('für', 17),
('eine', 15),
('des', 14),
('Die', 14),
('ODP', 14),
('wurde', 13),
('zu', 13)]
使用以下代码,我将其转换为熊猫数据帧:
^{pr2}$然后我把它画出来:
fig, ax_lst = plt.subplots(1,1) # a figure with a 2x2 grid of Axes
df10 = df.copy()
df10 = df[:20]
df10.Vorkommen.plot(kind='barh')
plt.show()
如何将y轴从索引更改为单词?在
默认情况下,
plot.barh
使用索引。可以如下显式设置x和y值:您可以使用^{} }将使用
^默认情况下,{
DataFrame
的索引作为标签。在相关问题 更多 >
编程相关推荐