
上QQ阅读APP看书,第一时间看更新
Saving the figure
Now we have drawn our first figure. Let's save our work! Surely we don't want to resort to screen capture. Here is a simple way to do it by calling pyplot.savefig().
If you want to both view the image on screen and save it in file, remember to call pyplot.savefig() before pyplot.show() to make sure you don't save a blank canvas.