matplotlib使用技巧

关闭坐标刻度

plt.xticks([])

保存背景透明图片
plt.savefig(img_path,transparent=True)

关闭绘图窗口

plt.close() will close current instance.
plt.close(2) will close figure 2
plt.close(plot1) will close figure with instance plot1
plt.close('all') will close all fiures

画图时,show()是个阻塞函数总是要放在最后,它阻止命令继续往下运行

你可能感兴趣的:(数据分析)