-
Notifications
You must be signed in to change notification settings - Fork 628
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 title? #399
Comments
Ehen mplfinance applies its styles, it first appies a matplotlib style and these matplotlib styles modify rcParams. The way to make this work would be to include the desired font.family in the style. For example, suppose you wanted to use style 'yahoo' , but with Chinese characters. You should be able to do so like this: rcpdict = { 'font.family' : 'Noto Sans CJK SC' }
s = mpf.make_mpf_style(base_mpf_style='yahoo',rc=rcpdict)
mpf.plot(data,...,style=s) Please let me know if that works for you. |
I have solved the issue through adjusting the rcpdict = { 'font.family' : ['AR PL UKai CN', 'sans-serif']} The string 'Noto Sans CJK SC' should be a font name but my system doesn't have. So, thank you for your prompt, Daniel. You're very nice. At last, for any other who is bored by this issue, you should apply the $ fc-list :lang=zh family |
@run27017 |
It seems cannot display Chinese well, following is the test code:
df
is the stock trading code looks like:My machine is openSUSE Tumbleeweed, and the python version is 3.8.10. The version of
mpf
lib is 0.12.7a17.The text was updated successfully, but these errors were encountered: