Matplotlibs SVG文本渲染可以在matplotlibrc或代码中配置.来自http://matplotlib.org/users/customizing.html:
#svg.fonttype : 'path' # How to handle SVG fonts: # 'none': Assume fonts are installed on the machine where the SVG will be viewed. # 'path': Embed characters as paths -- supported by most SVG renderers # 'svgfont': Embed characters as SVG fonts -- supported only by Chrome, # Opera and Safari
这转换为以下代码既不嵌入字体也不将文本呈现为路径:
import matplotlib.pyplot as plt plt.rcParams['svg.fonttype'] = 'none'