我在Jupyter中得到了下面的代码,当前遵循的是关于DataCamp的教程,但是我的图没有生成
import matplotlib as mpl
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
plt.show()
seattle_weather_dic = {'MONTH':['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
'MLY-TAVG-NORMAL':[42.1,43.4,46.6,50.5,56.0,61.0,65.9,66.5,61.6,53.3,46.2,41.1]}
seattle_weather = pd.DataFrame.from_dict(seattle_weather_dic)
ax.plot(seattle_weather["MONTH"], seattle_weather["MLY-TAVG-NORMAL"])
plt.show()
试试这个:
我已经定义了
ax
,并在'MONTH'
之后添加了一个:
相关问题 更多 >
编程相关推荐