Convert matplotlib imshow, contourf, and pcolormesh images to an image format

Saving a plot by matplotlib imshow, contourf, or pcolormesh to a pdf file via savefig. It can be opened by Illustrator to handle it as a vector illustration. To use the illustration in a manuscript made by latex, it is exported in an image format. To do this, I needed some trials-and-errors. Finally I got the following setting in a satisfactory quality:

  • Jpeg
  • Resolution: High (300 ppi)
  • Anti-aliasing: Art Optimized (Supersampling)
  • Quality: 10 (highest)