python - 绘图无法正确显示
问题描述
我试图为我的数据绘制条形图,但我不知道为什么我在运行单元格时不断收到“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()
解决方案
推荐阅读
- c++ - 如何将 CSV 文件列的值保存在数组中,以便我们可以在 C++ 中的循环外使用该数组?
- uiimageview - swiftui 剪辑未剪切图像
- python - 如何在 Python 中同时访问另一个函数的变量?
- javascript - 如何在 JavaScript/React 中创建水平时间线/日历?
- javascript - 如何在 Google Apps 脚本中动态创建新工作表时附加第一行数据
- abp - ABP vnext:自动 API 控制器:默认需要身份验证
- angular - 角度路由 - 触发活动路由但不改变其他任何内容
- ruby - 为什么捆绑器找不到兼容版本?
- java - 如何使用递归函数代替嵌套循环?
- wamp - 无法使用 WAMP 服务器连接到 MySQL 数据库