import matplotlib.pyplot as plt

plt.title("热门城市分析") x_label = city_num.index[:10] y = city_num.values[:10] plt.bar(x_label, y) for x, y in enumerate(y): plt.text(x, y + 5, str(y), ha='center') plt.show()

plttit1e热门城市分析x_label city_numindex10y city_numvalues10pltbarx_labelyfor xy in enumerateyplttextxy+5stryha=centerpltshow请格式化上面这段代码

原文地址: http://www.cveoy.top/t/topic/i60S 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录