用默认的 plt.savefig()保存的图片,图利和label都是以瞄点保存的,而不是以文字格式。这样在矢量图编辑中想要调整文字大小和字体时都不方便。使用mpl可以设置pdf图片文字以字体形式保存:
# matplot 输出的图片为illustrator可编辑的字体import matplotlib as mplmpl.rcParams['pdf.fonttype'] = 42mpl.rcParams['ps.fonttype'] = 42#保存pdfplt.savefig("multi-time—text.pdf",format="pdf")
导出的pdf文字在illustrator中可编辑。