Create a Figure with an array of two Axes objects that share their y-axis range. Plot Seattle's "MLY-PRCP-NORMAL" in a s

动态 未结 0 92
小小草
小小草 LV1 2023年9月23日 23:40 发表
下面是完整代码: ```python # Create a figure and an array of axes: 2 rows, 1 column with shared y axis fig, ax = plt.subplots(2, 1, sharey=True) # Plot Seattle precipitation data in the top axes ax[0].plot(seattle_weather.index, seattle_weather["MLY-PRCP-NORMAL"], color="blue") ax[0].plot(seattle_weather.index, seattle_weather["MLY-PRCP-25PCTL"], color="blue", linestyle="--") ax[0].plot(seattle_weather.index, seattle_weather["MLY-PRCP-75PCTL"], color="blue", linestyle="--") # Plot Austin precipitation data in the bottom axes ax[1].plot(austin_weather.index, austin_weather["MLY-PRCP-NORMAL"], color="red") ax[1].plot(austin_weather.index, austin_weather["MLY-PRCP-25PCTL"], color="red", linestyle="--") ax[1].plot(austin_weather.index, austin_weather["MLY-PRCP-75PCTL"], color="red", linestyle="--") plt.show() ```
收藏(0)  分享
相关标签: 智能问答
问题没解决?让AI助手帮你作答 AI助手
0个回复
  • 消灭零回复