我试图将使用 python graph_tool 库创建的图形输出到 png 文件。最终结果是绘制的图顶点重叠。我意识到问题是当我将文本放在顶点或边缘时,就像文本框的边距太大。
size = 4000
v_size = size/my_graph
e_pwidth = v_size/10
graph_draw(my_graph, vertex_shape='square', vertex_text=my_graph.vp.inst_str, vertex_size=v_size, output_size=(size, int(size*1.5), vertex_font_size=e_pwidth, vertex_aspect=1.5, edge_pen_width=e_pwidth, edge_text=my_graph.ep.edgelabel, output="f.png")
它将输出如下内容:
看看文本和顶点边界之间的距离,我无法减少那个距离。