昨天学习pandas和matplotlib的过程中, 在jupyter notebook遇到ImportError: matplotlib is required for plotting错误, 以下是解决该问题的具体描述...df.plot(x = "Year", y = "Agriculture")
5 plt.xlabel("Year")
6 plt.ylabel("Percentage")
7 plt.show()
在jupyter...df["Agriculture"]
5 plt.plot(df_year, df_Agriculture,"-", color = "r", linewidth = 5)
6 plt.show()
在jupyter...在pycharm中能够成功运行, 而在jupyter notebook中不能运行, 看起是IDE的问题, 那么两者存在什么差异呢:
就我个人电脑而言, pycharm是我刚刚启动的(安装好matplotlib...总结
个人猜想: 在使用pandas中的plot()方法时, matplotlip里的pyplot绘图框架仅仅是用来展示图形的, 而要想让两者实现交互, 那应该确保在启动IDE之前两者都被成功安装.