René's URL Explorer Experiment


Title: savefig to vector graphics with LaTeX fails with certain characters · Issue #10272 · matplotlib/matplotlib · GitHub

Open Graph Title: savefig to vector graphics with LaTeX fails with certain characters · Issue #10272 · matplotlib/matplotlib

X Title: savefig to vector graphics with LaTeX fails with certain characters · Issue #10272 · matplotlib/matplotlib

Description: Saving vector graphic figures with certain characters in LaTeX will fail. Here I tried to use the \textmu character. Could it be related to #8068? Code for reproduction Here I'm saving to PostScript. It gives an error that I think is the...

Open Graph Description: Saving vector graphic figures with certain characters in LaTeX will fail. Here I tried to use the \textmu character. Could it be related to #8068? Code for reproduction Here I'm saving to PostScrip...

X Description: Saving vector graphic figures with certain characters in LaTeX will fail. Here I tried to use the \textmu character. Could it be related to #8068? Code for reproduction Here I'm saving to PostS...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/10272

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"savefig to vector graphics with LaTeX fails with certain characters","articleBody":"Saving vector graphic figures with certain characters in LaTeX will fail. Here I tried to use the `\\textmu` character. Could it be related to #8068?\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\nHere I'm saving to PostScript. It gives an error that I think is the most informative and points to some problems with ghostscript. Outputs for SVG and PDF below.\r\n\r\n```python\r\nimport matplotlib\r\nmatplotlib.rcParams['text.usetex'] = True\r\nimport matplotlib.pyplot as plt\r\n\r\nfig = plt.figure()\r\nax = fig.add_subplot(111)\r\nax.set_ylabel(r'\\textmu')\r\nplt.savefig('fig.ps')\r\n```\r\n\r\n**Output - PS**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_ps.py\", line 1520, in gs_distill\r\n    report = subprocess.check_output(command, stderr=subprocess.STDOUT)\r\n  File \"/usr/lib/python3.6/subprocess.py\", line 336, in check_output\r\n    **kwargs).stdout\r\n  File \"/usr/lib/python3.6/subprocess.py\", line 418, in run\r\n    output=stdout, stderr=stderr)\r\nsubprocess.CalledProcessError: Command '['gs', '-dBATCH', '-dNOPAUSE', '-r6000', '-sDEVICE=ps2write', '-sPAPERSIZE=letter', '-sOutputFile=/tmp/tmpt8w23igm.ps', '/tmp/tmpt8w23igm']' returned non-zero exit status 1.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"Untitled.py\", line 8, in \u003cmodule\u003e\r\n    plt.savefig('fig.ps')\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/pyplot.py\", line 701, in savefig\r\n    res = fig.savefig(*args, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/figure.py\", line 1834, in savefig\r\n    self.canvas.print_figure(fname, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backend_bases.py\", line 2267, in print_figure\r\n    **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_ps.py\", line 910, in print_ps\r\n    return self._print_ps(outfile, 'ps', *args, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_ps.py\", line 937, in _print_ps\r\n    **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_ps.py\", line 1359, in _print_figure_tex\r\n    rotated=psfrag_rotated)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_ps.py\", line 1525, in gs_distill\r\n    '\\n\\n' % exc.output.decode(\"utf-8\")))\r\nRuntimeError: ghostscript was not able to process your image.\r\nHere is the full report generated by ghostscript:\r\nGPL Ghostscript 9.22 (2017-10-04)\r\nCopyright (C) 2017 Artifex Software, Inc.  All rights reserved.\r\nThis software comes with NO WARRANTY: see the file PUBLIC for details.\r\nError: /undefined in --get--\r\nOperand stack:\r\n   --nostringval--   --dict:9/18(ro)(L)--   112   --dict:13/13(L)--   --dict:13/13(L)--   base\r\nExecution stack:\r\n   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   2015   1   3   %oparray_pop   2014   1   3   %oparray_pop   1998   1   3   %oparray_pop   1884   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   %finish_stringwidth   --nostringval--   --nostringval--   14   8   0   --nostringval--   (pdf_text_enum_t)   %op_show_continue   --nostringval--\r\nDictionary stack:\r\n   --dict:986/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:5/6(ro)(L)--   --dict:180/300(L)--   --dict:44/200(L)--   --dict:8/17(L)--   --dict:51/90(L)--\r\nCurrent allocation mode is local\r\nLast OS error: No such file or directory\r\nCurrent file position is 58919\r\nGPL Ghostscript 9.22: Unrecoverable error, exit code 1\r\n```\r\n\r\n**Output - SVG, PDF**\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"Untitled.py\", line 8, in \u003cmodule\u003e\r\n    plt.savefig('fig.svg')\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/pyplot.py\", line 701, in savefig\r\n    res = fig.savefig(*args, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/figure.py\", line 1834, in savefig\r\n    self.canvas.print_figure(fname, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backend_bases.py\", line 2267, in print_figure\r\n    **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_svg.py\", line 1193, in print_svg\r\n    return self._print_svg(filename, svgwriter, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_svg.py\", line 1248, in _print_svg\r\n    self.figure.draw(renderer)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/artist.py\", line 55, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/figure.py\", line 1299, in draw\r\n    renderer, self, artists, self.suppressComposite)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/image.py\", line 138, in _draw_list_compositing_images\r\n    a.draw(renderer)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/artist.py\", line 55, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/axes/_base.py\", line 2437, in draw\r\n    mimage._draw_list_compositing_images(renderer, self, artists)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/image.py\", line 138, in _draw_list_compositing_images\r\n    a.draw(renderer)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/artist.py\", line 55, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/axis.py\", line 1147, in draw\r\n    self.label.draw(renderer)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/artist.py\", line 55, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/text.py\", line 762, in draw\r\n    mtext=mtext)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_svg.py\", line 1150, in draw_tex\r\n    self._draw_text_as_path(gc, x, y, s, prop, angle, ismath=\"TeX\")\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/backends/backend_svg.py\", line 950, in _draw_text_as_path\r\n    return_new_glyphs_only=True)\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/textpath.py\", line 335, in get_glyphs_tex\r\n    font_bunch = self.tex_font_map[dvifont.texname]\r\n  File \"/home/mirek/.local/lib/python3.6/site-packages/matplotlib/dviread.py\", line 850, in __getitem__\r\n    result = self._font[texname]\r\nKeyError: b'tcss3583'\r\n```\r\nFor PDF it's nearly identical; the last line reads: \r\n```\r\nKeyError: b'tcss1000'\r\n```\r\n\r\nIn case of PS and SVG, no file is produced. In case of PDF, a corrupted file results. Saving to raster formats and inline previews in jupyter notebook work fine.\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n  * Operating system: Debian 10\r\n  * Matplotlib version: 2.1.1\r\n  * Python version: 3.6.4\r\n\r\nMatplotlib from pip. Both Matplotlib and LaTeX are installed in userspace\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/miromarszal","@type":"Person","name":"miromarszal"},"datePublished":"2018-01-20T18:20:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/10272/matplotlib/issues/10272"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:879fd268-6fc4-682f-24cf-7e30bb210690
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEA8A:217E0D:61E2A7:8438F1:6A5254CF
html-safe-nonce91aee95f3ef44e5c8992fd86f73cd3fc76e19ae06d4c8130da7c54a89fdc2226
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQThBOjIxN0UwRDo2MUUyQTc6ODQzOEYxOjZBNTI1NENGIiwidmlzaXRvcl9pZCI6IjI5NjY5OTEwNDM2ODAxNjMwMjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9abe1a1d0eedbd26371675e4f2126d29f365957af4933b15689fc5b8890de6d7
hovercard-subject-tagissue:290212154
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/10272/issue_layout
twitter:imagehttps://opengraph.githubassets.com/edc428b84fc1d853a9d2aa6541dd6a922fbab4bd42e944c2da1236c15a70d198/matplotlib/matplotlib/issues/10272
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/edc428b84fc1d853a9d2aa6541dd6a922fbab4bd42e944c2da1236c15a70d198/matplotlib/matplotlib/issues/10272
og:image:altSaving vector graphic figures with certain characters in LaTeX will fail. Here I tried to use the \textmu character. Could it be related to #8068? Code for reproduction Here I'm saving to PostScrip...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemiromarszal
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7aed05249554b889eb33d002851a973eebcc7e91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/10272#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F10272
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F10272
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/10272
Reloadhttps://github.com/matplotlib/matplotlib/issues/10272
Reloadhttps://github.com/matplotlib/matplotlib/issues/10272
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/10272
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/10272
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
savefig to vector graphics with LaTeX fails with certain charactershttps://github.com/matplotlib/matplotlib/issues/10272#top
topic: text/usetexhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20text%2Fusetex%22
https://github.com/miromarszal
miromarszalhttps://github.com/miromarszal
on Jan 20, 2018https://github.com/matplotlib/matplotlib/issues/10272#issue-290212154
#8068https://github.com/matplotlib/matplotlib/issues/8068
topic: text/usetexhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20text%2Fusetex%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.