Skip to content Skip to sidebar Skip to footer

Python - Debugging: Loop For Plotting Isn't Showing The Next Plot

I need help in debugging. I just can't figure out why it's not working as expected. The Code below should read data files (names are stored in all_files) in chunks of 6, arrange th

Solution 1:

The problem is likely that plt.show() is inside the loop. Generally, it should only be called once, after all the figures have been created. Because once it’s called, matplotlib thinks it’s done.

To solve this, I had to move fig, axes = plt.subplots… inside the first for-loop, and add a fig.close() after plt.show().

Post a Comment for "Python - Debugging: Loop For Plotting Isn't Showing The Next Plot"