Skip to content

Please soon add Chinese language support!! It's to difficult for new people handle character #12597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liam-nirvana opened this issue Oct 23, 2018 · 6 comments

Comments

@liam-nirvana
Copy link

Thank you guys....

@anntzer
Copy link
Contributor

anntzer commented Oct 23, 2018

You need to pick an otf font that actually supports Chinese but other than that, it's already working...

from matplotlib.font_manager import FontProperties
from matplotlib import pyplot as plt

plt.title(
    "黑體",
    fontproperties=FontProperties(
        fname="/usr/share/fonts/adobe-source-han-sans-tw/SourceHanSansTW-Regular.otf"))
plt.show()

test

See #9787 for ttc support and #10249 for font selection issues.

@anntzer
Copy link
Contributor

anntzer commented Oct 23, 2018

Actually that's essentially documented at https://matplotlib.org/tutorials/text/text_props.html#text-with-non-latin-glyphs. Closing, but feel free to ping with more questions.

@liam-nirvana
Copy link
Author

liam-nirvana commented Oct 24, 2018 via email

@tacaswell
Copy link
Member

@liam-nirvana Glad you got this sorted! Fonts are surprisingly hard....

@fighting41love
Copy link

Same problem. It's really terrible experience to modify the font. Many people fix the problem for hours.....I spent 2 hours on it. Failed.

@anntzer
Copy link
Contributor

anntzer commented Nov 6, 2018

We can make the experience better by putting #9175 back in with a slightly more verbose error message (it was reverted in #11615 due to other issues).
I'll leave this closed, as #8765 already tracks the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants