graphviz Windows中文乱码

来源:互联网 发布:南京网络问政 编辑:程序博客网 时间:2024/06/05 10:44

1.第一步:

C:\Program Files (x86)\Graphviz2.37\etc\fonts    fonts.conf

<dir>C:/WINDOWS/Fonts</dir>
 <dir>~/.fonts</dir>


2.第二步,在保存时保存为utf-8或者手动utf-8格式:

with open("D:\\id3.dot","w",-1,"utf-8") as f:


3.第三步:在保存文件前面修改如下:

edge [fontname="Microsoft YaHei"];

node [shape=box, fontname="Microsoft YaHei" size="20,20"];