How to set up networkx in Chinese
Problem description
Hi, everynone,
when we use networkx to display Chinese, we will find that Chinese cannot be displayed.
Solution
Download the font in the attachment;
https://github.com/hivandu/practise/blob/master/resource/SimHei.ttf
Execute in jupyter notebook
1 |
|
Find the path to matplotlib, and then cd to this path, after cd to
this path, continue cd, cd to the path map-data/fonts/ttf
.
Then replace the file DejaVuSans,ttf
with the file we
just.
1 |
|
Among them, the ttf font used. I have uploaded it to everyone.
How to set up networkx in Chinese