效果:每次显示一组散点图
for j in (a,b)
parti_postion = np.array(parti_postion)
plt.scatter(parti_postion[:,0], parti_postion[:,1])
plt.pause(0.1)
plt.clf()
plt.show()
效果:动态显示折线的变化过程。
for j in (a,b)
plt.plot(iter_sequen, gbest_sequen, '-r', label="cost")
plt.xlabel("iter")
plt.ylabel("cost")
if j==0:
plt.legend() #折线的label只需添加一次
plt.pause(0.1)
plt.show()
```