matplotlib.pyplot不出图,能正常运行但是不出图
import matplotlib.pyplot as plt
def visualizeModel(x,y,ols,lad):
fig= plt.figure(figsize=(12,6),dpi=80)
ax2= fig.add_subplot(121)
ax3= fig.add_subplot(122)
ax2.set_xlabel("$x$")
ax2.set_xticks(range(0,250000,25000))
ax2.set_ylabel("$y$")
ax2.set_title('OLS')
ax3.set_xlabel("$x$")
ax3.set_xticks(range(0, 250000, 25000))
ax3.set_ylabel("$y$")
ax3.set_title('LAD')
ax2.scatter(x,y, color= "b",alpha=0.4,label='实验数据')
ax2.plot(x,ols,label='预测数据')
ax3.scatter(x, y, color="b", alpha=0.4, label='实验数据')
ax3.plot(x,lad,label='预测数据')
plt.legend(shadow=True)
plt.show()
C:\pyanzhuang\envs\小白到专家\python.exe C:/Users/啦啦啦/PycharmProjects/小白到专家/7.2p140.py
进程已结束,退出代码0