Title: Issue · GitHub
Open Graph Title: Issue · matplotlib/matplotlib
X Title: Issue · matplotlib/matplotlib
Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Open Graph Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
X Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Opengraph URL: https://github.com/matplotlib/matplotlib
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Chinese font can`t change the weight","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\nI found that when I use Chinese font, I can`t set the weight. When I change the value of weight, It does not work. \r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\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\nWhen I try this\r\n```python\r\nweights = ['light', 'normal', 'medium', 'semibold', 'bold', 'heavy', 'black']\r\naxis('off')\r\nfor i in enumerate(weights):\r\n num,weight=i\r\n text(0.5,0.2*num,u'ABC',fontdict={\r\n 'family':'KaiTi',\r\n 'weight':weight,\r\n 'size':30\r\n })\r\n text(0,0.2*num,u'哈哈哈',fontdict={\r\n 'family':'KaiTi',\r\n 'weight':weight,\r\n 'size':30\r\n })\r\nshow()\r\n```\r\nThe results show it dose not work.\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\nAnd when I comment out this line of code\r\n```python\r\nweights = ['light', 'normal', 'medium', 'semibold', 'bold', 'heavy', 'black']\r\naxis('off')\r\nfor i in enumerate(weights):\r\n num,weight=i\r\n text(0.5,0.2*num,u'ABC',fontdict={\r\n # 'family':'KaiTi',\r\n 'weight':weight,\r\n 'size':30\r\n })\r\n text(0,0.2*num,u'哈哈哈',fontdict={\r\n # 'family':'KaiTi',\r\n 'weight':weight,\r\n 'size':30\r\n })\r\nshow()\r\n```\r\n.........:(\r\n\r\n\r\nI guess maybe it doesn't support Chinese bold. :(\r\n","author":{"url":"https://github.com/Slime0","@type":"Person","name":"Slime0"},"datePublished":"2019-10-26T13:50:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/15529/matplotlib/issues/15529"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:e3fa7173-b2e1-3528-0c63-ed562bc13a8b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A510:10637F:1665C2A:1DA8DE4:6A51C43B |
| html-safe-nonce | 35b20326b023b63bb9005e9dce972a7c271357e5c446d1626f2d92f0c18a3c6a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTEwOjEwNjM3RjoxNjY1QzJBOjFEQThERTQ6NkE1MUM0M0IiLCJ2aXNpdG9yX2lkIjoiMjU2NjEwMDcwNzUzMTkzMjczMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 58a5260748a0c207423bdbe8d771e492d3d10547f70367a417d7af44af62ebef |
| hovercard-subject-tag | repository:1385122 |
| 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/matplotlib/matplotlib/issues/15529 |
| twitter:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| og:image:alt | matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-cache |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width