Title: Trouble saving svg file when plot contains special characters · Issue #8280 · matplotlib/matplotlib · GitHub
Open Graph Title: Trouble saving svg file when plot contains special characters · Issue #8280 · matplotlib/matplotlib
X Title: Trouble saving svg file when plot contains special characters · Issue #8280 · matplotlib/matplotlib
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 chara...
Open Graph 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 ...
X 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 ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8280
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Trouble saving svg file when plot contains special characters","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nWhile 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.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nplt.rcParams['text.usetex'] = True\r\nplt.rcParams['text.latex.preamble'] = '\\usepackage{siunitx},\\usepackage{libertine}'\r\nplt.xlabel(r'$\\si{\\degree}$')\r\nplt.tight_layout()\r\nplt.savefig('plot.svg')\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\n```\r\n/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\r\n```\r\n\r\n**Expected outcome**\r\n\r\nIdeally, the SVG file should contain a plot with the x-axis labeled with a degree sign.\r\n\r\n**Matplotlib version**\r\n\r\n- Matplotlib version 2.0.0\r\n- Python version 2.7.12\r\n- Platform Linux Mint 18.1\r\n- Python installed from Linux Mint repos\r\n- Matplotlib installed using pip\r\n","author":{"url":"https://github.com/mirthquake","@type":"Person","name":"mirthquake"},"datePublished":"2017-03-13T05:39:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/8280/matplotlib/issues/8280"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:72190644-62d3-7753-0b12-5e0098a35933 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBDA:39E76C:9093D0:C6CBD7:6A5392E3 |
| html-safe-nonce | 129f73ffa64823ef1d2f4286c5dd056edeaf3b02757c2260c314bc1a5f1b76a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkRBOjM5RTc2Qzo5MDkzRDA6QzZDQkQ3OjZBNTM5MkUzIiwidmlzaXRvcl9pZCI6IjgxMzUwNjQyMTk2MDEzMTA0MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2863b0fd2b9ea478310f972852df42a938fdce02cb863719d0b50fbb7bd2ee45 |
| hovercard-subject-tag | issue:213678505 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/8280/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa49e8bd023280eec6ce0c0d416d11873416f71d15f3db10efcf013fcdefc422/matplotlib/matplotlib/issues/8280 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa49e8bd023280eec6ce0c0d416d11873416f71d15f3db10efcf013fcdefc422/matplotlib/matplotlib/issues/8280 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mirthquake |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width