matplotlib - plot outputs text as paths and cannot be converted to LaTeX by Inkscape

余生颓废 提交于 2019-12-02 18:15:37

I ran into the same problem and fixed it.

The matplotlib documentation in http://matplotlib.org/users/customizing.html states that the default value for the parameter svg.fonttype is 'path', which means that characters will be converted to paths when exporting to svg format.

All I needed to do was add the following line in my script:

matplotlib.rcParams['svg.fonttype'] = 'none'

This way all characters are embedded correctly, I can now edit the text in Inkscape and export my figure to pdf+Latex, i.e. a pdf file and a pdf_tex file which I include in my tex file.

Another, more permanent option, is to put

svg.fonttype : none

in your matplotlibrc (~/.config/matplotlib/matplotlibrc, for example)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!