Skip to content
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

how to display chinese properly (ubuntu version) #1

Open
ygl-rg opened this issue Jun 20, 2020 · 0 comments
Open

how to display chinese properly (ubuntu version) #1

ygl-rg opened this issue Jun 20, 2020 · 0 comments

Comments

@ygl-rg
Copy link
Owner

ygl-rg commented Jun 20, 2020

  1. download simhei.ttf

  2. copy to /python/lib/python3.8/site-packages/matplotlib/mpl-data/fonts/ttf

  3. rm ~/.cache/matplotlib

  4. add following to the script file.

      import matplotlib
     matplotlib.rcParams['font.sans-serif'] = ['simhei']
     matplotlib.rcParams['axes.unicode_minus'] = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant