如果您不使用来创建图形
plt.figure,则应按预期对它进行引用计数。例如((这也使用了非交互式的Agg后端。)
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvasfrom matplotlib.figure import Figure# The pylab figure manager will be bypassed in this instance.# This means that `fig` will be garbage collected as you'd expect.fig = Figure()canvas = FigureCanvas(fig)ax = fig.add_subplot(111)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)