Title: Plotting legend throws error "font family ['serif'] not found. Falling back to DejaVu Sans" · Issue #17518 · matplotlib/matplotlib · GitHub
Open Graph Title: Plotting legend throws error "font family ['serif'] not found. Falling back to DejaVu Sans" · Issue #17518 · matplotlib/matplotlib
X Title: Plotting legend throws error "font family ['serif'] not found. Falling back to DejaVu Sans" · Issue #17518 · matplotlib/matplotlib
Description: Bug report Bug summary Matplotlib shows a warning when adding a legend to a graph while using the TeX backend. Error is: findfont: Font family ['serif'] not found. Falling back to DejaVu Sans. A typical looking graph is supplied but I'm ...
Open Graph Description: Bug report Bug summary Matplotlib shows a warning when adding a legend to a graph while using the TeX backend. Error is: findfont: Font family ['serif'] not found. Falling back to DejaVu Sans. A ty...
X Description: Bug report Bug summary Matplotlib shows a warning when adding a legend to a graph while using the TeX backend. Error is: findfont: Font family ['serif'] not found. Falling back to DejaVu Sa...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/17518
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Plotting legend throws error \"font family ['serif'] not found. Falling back to DejaVu Sans\"","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\r\nMatplotlib shows a warning when adding a legend to a graph while using the TeX backend.\r\nError is: _findfont: Font family ['serif'] not found. Falling back to DejaVu Sans._\r\nA typical looking graph is supplied but I'm unsure as to the correctness of the legend font.\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\n```python\r\nfrom matplotlib import rc\r\nimport matplotlib.pyplot as plt\r\n\r\nrc('font', **{'family':'serif','serif':'Computer Modern'})\r\nrc('text', usetex=True)\r\n\r\nplt.figure()\r\nplt.plot(0,0,label='Input')\r\nplt.title('Commenting out legend removes warning')\r\n\r\nplt.legend()\r\n\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\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\nfindfont: Font family ['serif'] not found. Falling back to DejaVu Sans.\r\n```\r\nThe graph is output normally.\r\n\r\n**Expected outcome**\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\r\n\r\nNo errors, and a key that works.\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: Ubuntu Focal Fossa GNOME Terminal 3.36.1.1\r\n * Matplotlib version: 3.2.1\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): GTK3Agg\r\n * Python version: 3.8.2 (GCC 9.3.0 on linux)\r\n * Jupyter version (if applicable): NA\r\n * Other libraries: \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\nmatplotlib was installed via pip (20.1.1), and python was installed via apt.","author":{"url":"https://github.com/Struan-Murray","@type":"Person","name":"Struan-Murray"},"datePublished":"2020-05-27T13:43:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/17518/matplotlib/issues/17518"}
| 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:f200134f-fc21-f2f9-6c0d-1566c99a1c07 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9874:20FBF5:158BDB7:1CBA4E4:6A52B613 |
| html-safe-nonce | 2e31d34050a034cce23deb6d7f34218b0a006a0c28a146841fa4828ef3494895 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODc0OjIwRkJGNToxNThCREI3OjFDQkE0RTQ6NkE1MkI2MTMiLCJ2aXNpdG9yX2lkIjoiNDE1Njc5MjgwNTM5MjU2MTY4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f09d33280136c8047e86523ec96b3c2dfa465a89f3fe4e284d2a42c6e7e2150d |
| hovercard-subject-tag | issue:625708231 |
| 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/17518/issue_layout |
| twitter:image | https://opengraph.githubassets.com/36ee65bf57dd10644571730a7185ddfe342dc55fe2f3bedfc13553422d6ca603/matplotlib/matplotlib/issues/17518 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/36ee65bf57dd10644571730a7185ddfe342dc55fe2f3bedfc13553422d6ca603/matplotlib/matplotlib/issues/17518 |
| og:image:alt | Bug report Bug summary Matplotlib shows a warning when adding a legend to a graph while using the TeX backend. Error is: findfont: Font family ['serif'] not found. Falling back to DejaVu Sans. A ty... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Struan-Murray |
| 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