将有向图渲染为png

2024-05-08 22:05:11 发布

您现在位置:Python中文网/ 问答频道 /正文

完全是Python。如何从中渲染PNG文件

// My New Network
digraph {
    graph [splines=ortho]
        node [shape=box]
        node [image="./images/switch1.png"]
        edge [weight=10]
        edge [arrowhead=none]
    label = "\n\nMy Prettier Network Diagram w/ straight edges"
    fontsize=20
        Arista249
        HP830_LSW
        HP_5500EI
        HP_5500EI
            Arista249 -> HP830_LSW
            Arista249 -> HP_5500EI
            Arista249 -> HP_5500EI
}

Tags: 文件nodenewpngmynetworkgraphhp