RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (matplotlib.pyplot.figure) are retained until explicitly closed and may consume too much memory

課題
mpfで連続してfigureを出力したときメモリエラーが出る
解決法下記の関数のようにreturn_plot=Trueにし,plt.clf()とplt.close()をこの順番で入れる
from mplfinan ...2枚のプロットを連続して出力する方法[Matplotlib]

plt.scatter(transformed_pca, transformed_pca)plt.xlim(-0.1,1.1)plt.ylim(-0.1,1.1)plt.savefig('./pca.png')plt.figure(2)pl ...