matplotlib作图
import numpy as np
import matplotlib.pyplot as plt
a= np.arange(0,3*np.pi,0.5)
b= np.sin(a)
plt.plot(a,b)
plt.show()
一般容易出现import matplotlib as plt的误写导致
AttributeError: module ‘matplotlib‘ has no attribute ‘plot‘
又或者出现vars() argument must have __dict__ attribute的问题
这个一般解决方案是打开pycharm的setting->tool->python scientific->取消勾线show plots in tool window->apply->ok即可

浙公网安备 33010602011771号