matplotlib.pyplot.gcf#

matplotlib.pyplot.gcf()[source]#

获取当前图形(figure)。

如果 pyplot 图形栈中当前没有图形,则会使用 figure() 创建一个新的图形。(若要测试 pyplot 图形栈中当前是否有图形,请检查 get_fignums() 是否为空。)