我必须将月份名称显示为 xticks,当我绘制图形并将 x 作为月份名称传递时,它会绘制错误。我还必须在线图上叠加散点图。
我无法在此处粘贴完整的代码,因为它是 MOOC 作业,我只是在寻找我在这里做错了什么。
plt.figure(figsize=(8,5))
plt.plot(mint['Mean'],linewidth= 1, label = 'Minumum')
plt.plot(maxt['Mean'],linewidth = 1, label = 'Maximum')
plt.scatter(broken_low,mint15.iloc[broken_low]['Mean'],alpha = 0.75)
plt.scatter(broken_high,maxt15.iloc[broken_high]['Mean'],alpha = .75)
Run Code Online (Sandbox Code Playgroud)
数据集链接在这里:
https://drive.google.com/file/d/1qJnnHDK_0ghmHQl4OuyKDr-0K5ETo7Td/view?usp=sharing
它应该看起来像这样,填充线之间的面积,x 轴为月份,y 轴为摄氏度