I have a method that returns an array of matplotlib.figure.Figure objects, I call pyplot.close() afterwards an keep the objects. I want to redraw those Figure objects as subplots of one Figure.
It looks like this
import matplotlib.pyplot as plt
FIGS = list()
for indx, i in enumerate(HISTARR):
FIGS.append(subHistogramClientWrapper(indx, LIST, HISTARR.size(), i))
plt.close()
for each in FIGS:
plt.draw()
plt.show()
## This code below will crash, since add_subplot can't receive a figure
figo_help_me = plt.figure(1, figsize=(12, 3))
for each in FIGS:
figo_help_me.add_subplot(each)
plt.show()
Should I return one figure with subplots?
If so, how do I redraw a figure after calling plt.close()?