画图
示例代码:
import matplotlib.pyplot as plt
x = range(10)
y = [ele**2 for ele in x]
plt.figure()
plt.plot(x,y,linestyle='None', marker='*',markerfacecolor='blue',markersize=10)
plt.show()
其中plt.show()是阻塞的
保存图片
import matplotlib.pyplot as plt
x = range(10)
y = [ele**2 for ele in x]
plt.figure()
plt.plot(x,y,linestyle='None', marker='*',markerfacecolor='blue',markersize=10)
plt.savefig("filename.png")
fig = plt.gcf()
plt.show()
fig.savefig('tessstttyyy.png', dpi=1000)