'Matplotlib: Is there a way to use previous plots in a newer subplot?

I'm currently running a loop that exports a 2 column, 1 row subplot (initial state, final state where initial_state needs to have a circle patch and an arrow drawn.) on each iteration but I'd like to have a way of, when that loop ends, show on a big plot all the previous subplots together on a 2 column, N row subplot. Is there a way to "save" previous plots and then "append them" on the new figure once the loop ends?

I was looking for something in the sorts of:

initials = []
finals = []

while done == False:
    fig, (initial_state,final_state) = plt.subplots(1,2)
    initial_state.imshow(initial_state_data)
    initial_state.add_patch(circle)
    initial_state.arrow(arrow_parameters)
    initial_state.set_title('Title 1')
    final_state.imshow(final_state_data)
    final_state.set_title('Title 2')

    initials.append(initial_state)
    finals.append(final_state)

fig2,big_plots = plt.subplot(n,2) #n is the number of iterations in this case
for i in range(n):
    big_plots[i,0] = initials[i]
    big_plots[i,1] = finals[i]

Of course, I'm pretty sure that appending plots to a list is not going to work, but I feel like that's the easiest way to explain what I needed.

This seems like a simple enough thing to do, but I've been looking for days and couldn't find anything.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source