-
Couldn't load subscription status.
- Fork 0
Matplotlib
Problem: PDF files generated with matplotlib (observed in v3.5) contain text that is read
as object/shape per letter by Adobe Illustrator. May also be a problem for other third-party
tools.
Solution: set the following font type after importing matplotlib
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42Source: online 2022-09-22
Further explanation on font type 42: Wikipedia
Problem: PDF or PNG plots have transparent background despite you setting transparent=False when calling savefig().
Solution: this weird problem can be solved by setting the following options
.savefig(... , transparent=None, facecolor="w")Source: github issue 14339
Copyright © 2022-2025 Core Unit Bioinformatics, Medical Faculty, HHU
All content in this Wiki is published under the CC BY-NC-SA 4.0 license.