Create a Figure and an array of subplots with 2 rows and 2 columns. Addressing the top left Axes as index 0, 0, plot the

动态 未结 0 174
小小草
小小草 LV1 2023年9月23日 23:40 发表
下面是完整代码: ```python # Create a Figure and an array of subplots with 2 rows and 2 columns fig, ax = plt.subplots(2, 2) # Addressing the top left Axes as index 0, 0, plot month and Seattle precipitation ax[0, 0].plot(seattle_weather["MONTH"], seattle_weather["MLY-PRCP-NORMAL"]) ax[0, 0].set_title("Seattle Precipitation") # In the top right (index 0,1), plot month and Seattle temperatures ax[0, 1].plot(seattle_weather["MONTH"], seattle_weather["MLY-TAVG-NORMAL"]) ax[0, 1].set_title("Seattle Temperatures") # In the bottom left (1, 0) plot month and Austin precipitations ax[1, 0].plot(austin_weather["MONTH"], austin_weather["MLY-PRCP-NORMAL"]) ax[1, 0].set_title("Austin Precipitation") # In the bottom right (1, 1) plot month and Austin temperatures ax[1, 1].plot(austin_weather["MONTH"], austin_weather["MLY-TAVG-NORMAL"]) ax[1, 1].set_title("Austin Temperatures") plt.show() ```
收藏(0)  分享
相关标签: 智能问答
问题没解决?让AI助手帮你作答 AI助手
0个回复
  • 消灭零回复