首页 > 解决方案 > 绘图无法正确显示

问题描述

我试图为我的数据绘制条形图,但我不知道为什么我在运行单元格时不断收到“matplotlib 折旧警告”。这里是代码,非常感谢你的帮助,因为我刚开始学习 python。

#make an empty plot
fig1 = plt.figure(figsize=(30,20))

#plotting
ax0 = fig1.add_subplot(1,1,1)
ax0.bar(plot_set, height = 10)

#set labels
x_label = ["January", "Febury", "March", "April", "May", "June"]
x_title = ["Month"]
y_title = ["Number of flights"]

ax0.set_ylabel(y_title)
ax0.set_title('Impact of COVID-19 on airlines')

x = np.arange(len(x_label))
ax0.set_xticks(x)
ax0.set_xticklabels(x_label)
ax0.set_xlabel('x_title')

plt.show()

标签: pythonmatplotlib

解决方案


推荐阅读