点状星形图?

发布于 2024-08-07 09:10:23 字数 117 浏览 3 评论 0原文

Ḧi,

我想使用点语言绘制一个图形,看起来像一颗星(一个中心节点,所有其他节点都有一个链接到该另一个节点)。

我一直在谷歌上搜索但没有发现太多。你有一个基本的例子吗?

谢谢

Ḧi,

I'd like to draw a graph using the dot language that looks like a star ( a central node, wih all the other nodes with one link to this other node).

I've been googling around without finding much. Do you have a basic example ?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丢了幸福的猪 2024-08-14 09:10:23

尝试使用 twopi 作为布局器并选择径向布局。

Try twopi as the layouter and select radial layout.

一腔孤↑勇 2024-08-14 09:10:23

使用这个例子

    graph g {

    node1 [label="1"]
    node2 [label="2"]
    node3 [label="3"]
    node4 [label="4"]
    node5 [label="5"]
    node6 [label="6"]
    node7 [label="7"]

   node4 -- node3
   node4 -- node2 
   node4 -- node1
   node4 -- node5
   node4 -- node7
   node4 -- node6

   }

然后调用这个命令:
neato -T svg -o direct.svg direct.dot

输出如图所示:

图像描述

use this example

    graph g {

    node1 [label="1"]
    node2 [label="2"]
    node3 [label="3"]
    node4 [label="4"]
    node5 [label="5"]
    node6 [label="6"]
    node7 [label="7"]

   node4 -- node3
   node4 -- node2 
   node4 -- node1
   node4 -- node5
   node4 -- node7
   node4 -- node6

   }

Then invoke this commmand:
neato -T svg -o direct.svg direct.dot

output as shown:

image description

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文