TutteInstitute / datamapplot

Creating beautiful plots of data maps
MIT License
489 stars 34 forks source link

In the process of using, Chinese characters cannot be displayed. #14

Open binaryinspace opened 6 months ago

binaryinspace commented 6 months ago

First of all, thank you very much for this project. During my usage, I have already adjusted Matplotlib to display Chinese characters properly, but in DataMapPlot, Chinese characters cannot be displayed correctly, and I can only see boxes instead. I really appreciate your response.

khl20230929201241422
lmcinnes commented 6 months ago

I think this is an issue with the font used not supporting chinese characters. Note that DataMapPlot does not use the default matplotlib font -- you will need to actually specify the right font to use for DataMapPlot.

You can select the font, both for labels, and for the title and subtitle, via the fontfamily keyword argument and via the title_keywords and sub_title_keywords arguments that take dictionaries where you can specify the font (again via fontfamily). If you select a font on your system that does display the characters correctly then it should all work.