dot - 点的维恩图

标签 dot venn-diagram

我一直在尝试在点中实现维恩图。尽管维恩图在Dot中可能没有那么有用,但主要是因为我可以将其用作非常基本的构建基块。

我提供了一些尝试执行此操作的方法:

graph G {
    subgraph cluster0 {
        color=white;

        subgraph cluster0 {
            label="1";
            color=black;
            a;
            b;
        }

        subgraph cluster1 {
            label="2";
            color=black;
            b;
            c;
        }
    }


    subgraph cluster1 {
        color=white;

        subgraph cluster2 {
            label="1";
            color=black;
            d;
        }

        subgraph cluster3 {
            label="1+2";
            color=black;
            e;
        }

        subgraph cluster4 {
            label="2";
            color=black;
            f;
        }
    }


    subgraph cluster2 {
        color=white;

        subgraph cluster5 {
            label="1";
            color=black;
            g;

            subgraph cluster6 {
                label="2";
                color=black;
                h;
            }
        }

        subgraph cluster6 {
            label="2";
            color=black;
            i;
        }
    }

    a -- d -- g [penwidth=0];
    b -- e -- h [penwidth=0];
    c -- f -- i [penwidth=0];
}


生产:

three example Venn diagrams

这些都有问题:


第一个说b1中,但不在2中。什么时候都应该在两者中。
第二个看起来像是与12分开的。很难证明两者都是。
第三个几乎是完美的IMO,只需要将两个2子图连接在一起即可。




为防止XY问题,我有:


两台服务器,
两台服务器之间的docker集群,以及
三个应用。位于:


一个在第一台服务器上,而不是在docker swarm中。
一个在docker swarm中的第一台服务器上。
一个在docker swarm中的第二台服务器上。



导致:

graph G {
    subgraph cluster0 {
        color=white;

        subgraph cluster0 {
            label="Server1";
            color=black;
            a;

            subgraph cluster0 {
                label="Docker";
                b;
            }
        }

        subgraph cluster1 {
            label="Server2";
            color=black;

            subgraph cluster0 {
                label="Docker";
                c;
            }
        }
    }


    subgraph cluster1 {
        color=white;

        subgraph cluster0 {
            label="Server1";
            color=black;

            d;
        }

        subgraph cluster1 {
            label="Docker";
            color=black;

            subgraph cluster0 {
                label="Server1";
                e;
            }

            subgraph cluster1 {
                label="Server2";
                f;
            }
        }
    }

    a -- d [penwidth=0];
    b -- e [penwidth=0];
    c -- f [penwidth=0];
}


Two different ways to display the docker server grouping

最佳答案

我不确定您的问题到底是什么?但是可能无法使用graphviz制作维恩图。见Venn Diagram Drawing Algorithms

关于dot - 点的维恩图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49154480/

相关文章:

graphviz - 如何调整点图中边缘的方向?

graphviz - Graphviz DOT 文件中的多个图形

python - 如何在 python 中用集合大小的百分比标记维恩图?

r - 要在子集中显示的非数字条目的维恩图

scala - 是否有任何合适的方法可以直接从 Scala Parser Combinator 生成 [jpg、png 等] 语法图(和/或 AST)?

python - 如何在 Python 中解析 DOT 文件

C - 创建和写入文件时出现奇怪的字符

graphics - 如何用 4 组绘制维恩图

r - 从数据框制作维恩图

r - 在 R 中向维恩图添加百分比