出于好奇,您如何根据 PD 标签调整图形标签?enter image description here
#Create bar charts to show outliers:
fig, ax = plt.subplots()
a1['Word #'].value_counts().plot(ax=ax, kind='bar', x='Word #', y='Frequency')
我尝试给它贴上不同的标签,但我认为它不起作用。感谢您的所有帮助!
答案 0 :(得分:0)
您是否尝试过 xlabel()
和 ylabel()
?
#Create bar charts to show outliers:
fig, ax = plt.subplots()
a1['Word #'].value_counts().plot(ax=ax, kind='bar', x='Word #', y='Frequency')
plt.xlabel("Label what you want")
plt.ylabel("Label what you want")
plt.show()
或
ax.set_xlabel('xlabel')
ax.set_ylabel('ylabel')
plt.show()
这对于您的示例也可能更好:
lt.xticks(rotation=90)