当我在python中使用graphviz的子图时,我发现很难将子图的形状从矩形更改为 椭圆或圆形。我怎样才能做到这一点? 代码在
下面 from graphviz import Graph
g = Graph('G', filename='fdpclust.gv', engine='fdp')
with g.subgraph(name='clusterA',graph_attr ={'shape':'ellipse'}) as a:
a.node('a',fontname="SimSun",fontsize='29')
a.node('b')
with a.subgraph(name='clusterC',graph_attr ={'shape':'ellipse'}) as c:
c.attr(shape='ellipse')
c.node('C')
c.node('D')
with g.subgraph(name='clusterB',graph_attr ={'shape':'circle'}) as b:
b.node('d')
b.node('f')
g.view()
图片为:
答案 0 :(得分:0)
您无法设置簇的形状。您最能做的就是将样式设置为圆角以获得圆角