0
传说添加到图表中matplotlib我想要一个传说添加到频率分布图 如何在python
这是我使用的代码。
train_df.Medu.value_counts().plot(kind='bar', alpha=0.6)
plt.title("Distribution of Mother's education")
plt.legend()
我想补充表示什么0代表一个传奇,1个代表等,任何人都可以请帮我做到这一点?
这不是一个真正的传奇。您应该考虑在图表中添加[text](https://matplotlib.org/users/text_intro.html) –
您是否尝试过使用'plt.xticks([1,2,3,4],['primary', 'secondary','tertiary','quaternary'])'? – Guillermo
@Guillermo - 谢谢。这工作。我会代表你回答这个问题并接受。 –