使用
Figure.savefig()方法,如下所示:
ax = s.hist() # s is an instance of Seriesfig = ax.get_figure()fig.savefig('/path/to/figure.pdf')它不必以结尾结尾
或者,您可以使用该
pyplot接口,并仅
savefig作为函数调用来保存最近创建的图形:
import matplotlib.pyplot as plts.hist()plt.savefig('path/to/figure.pdf') # saves the current figure


