Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug report
Bug summary
While trying to save a plot containing special characters as an SVG image, I get an error message saying the glyph cannot be converted with the encoding and may be wrong. In the produced SVG file, the special character is displayed as a rectangle with a cross. I searched a bit online and found the solution to this problem was to set svg.fonttype to 'none' in matplotlibrc. When I do this, however, it appears that matplotlibrc cannot handle the single quotes around 'none', although the default (commented out) option 'path' is in quotes. If I write just none without quotes, I continue to get the same error message.
Code for reproduction
importmatplotlib.pyplotaspltplt.rcParams['text.usetex']=Trueplt.rcParams['text.latex.preamble']='\usepackage{siunitx},\usepackage{libertine}'plt.xlabel(r'$\si{\degree}$')plt.tight_layout()plt.savefig('plot.svg')plt.show()
Actual outcome
/usr/local/lib/python2.7/dist-packages/matplotlib/textpath.py:385: UserWarning: The glyph (176) of font (/usr/share/texmf/fonts/type1/public/cm-super/sfrm3583.pfb) cannot be converted with the encoding. Glyph may be wrong
Expected outcome
Ideally, the SVG file should contain a plot with the x-axis labeled with a degree sign.
Matplotlib version
- Matplotlib version 2.0.0
- Python version 2.7.12
- Platform Linux Mint 18.1
- Python installed from Linux Mint repos
- Matplotlib installed using pip