文章目录
症状
字体无法编译
报错信息 | C:\UserPro\python39\lib\tkinter\__init__.py:814: UserWarning: Glyph 24352 (\N{CJK UNIFIED IDEOGRAPH-5F20}) missing from current font.func(*args) |
---|---|
图片乱码,其实是字体无法编译 | ![]() |
解决
只需要在调用nx.draw_networkx时指定font_family 即可!此处指定为宋体SimSun.
import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph(