For my thesis I like many go to the the scipy matplotlib ecosystem for my processing of data.
I started analyzing my data in the past weeks and have made my python script such that i ingest a JSON file with different measurements. Per measurement I do some calculations and plot my data this
is done in parallel using mp.Pool.
Lately I have been getting these kind of images:
The data is plotted but somewhere something goes wrong.
I tried to set the dpi to be the same as the figure but no suffice.
The strange thing which image in the serie is corrupted is random, so my suspicion is that matplotlib’s savefig does not play nice with the thread pool.
Can someone confirm this and what is a proper way to do what i’m trying to do (return a figure handle from the threads and save the figures serially?)
Thanks for reading