matplotlib: How to assign the dpi of your figure to meet some set maximum file size?
You should do a for loop over different dpi values in decreasing order and in every loop save the image, check the file size and delete the image if filesize > 15 MB. After filesize < 15 MB break the loop.
Just wondering if there is a tried and tested method for setting the dpi output of your figure in matplotlib to be governed by some maximum file size, e.g., 15MB.