如何绘制邻接图?

如何绘制邻接图?

我想重新创建在友邦保险网站

邻接图

尝试强制genyoungtabtikzstackengine旋转来做到这一点,但没有成功。

有关的:有任何用于矩阵图的包吗?(使用 stackengine)

这是我使用 genyoungtabtikz 处理的结果。遗憾的是,文档指出,根据设计,该宏的旋转版本(“俄文格式”)在 tikzpicture 环境中无法正常工作。

\documentclass[]{article}
\usepackage{genyoungtabtikz}

\begin{document}
 \YRussian  
 \gyoung(1234,:\ 234,:\ :\ 34,:\ :\ :\ 4) 
\end{document}

答案1

一个可能的解决方案是,我们首先创建一个表节点,我们对其进行编号,然后,它通过旋转 45° 发送坐标系变化,以便轻松跟踪网格。网格的所有交叉点都已命名,然后只需在正确的位置绘制连接即可

在此处输入图片描述

\documentclass{article}

\usepackage[latin1]{inputenc}              
\usepackage[T1]{fontenc}     

\usepackage{tikz}

\usetikzlibrary{positioning,calc}

\definecolor{myblue}{rgb}{0.407,0.792,0.949}

\begin{document}

\begin{tikzpicture}
\def\hh{1.2em}
\foreach \nn [count=\ni] in {Vice President,Director,
    deputy director,environmental planning, center for development,
    office of research \& development,
    resource center,
    public information,
    community relations,
    administrative services,
    office of new programs,
    personnel,
    public
    }{
\node[text width=22em,draw=myblue,,minimum height=\hh,inner sep=0](n\ni) at (0,{-\ni*\hh}){\, \textsc{\nn}};
}

\begin{scope}[rotate=45]
\foreach \ii in {1,2,...,13}{
\draw[myblue] (n1.north east)|-(n\ii.south east);
\draw[myblue] (n\ii.north east)|-(n13.south east);
\foreach \jj in{\ii,...,13}{
\path (n\jj.east) -| node[circle](n\ii-\jj){} (n\ii.east);
}
}

\draw[fill=black] (n1-2) circle (0.2em);
\draw[fill=black] (n2-8) circle (0.2em);
\draw[fill=black] (n3-8) circle (0.2em);
\draw[fill=black] (n6-10) circle (0.2em);
\draw[fill=black] (n7-12) circle (0.2em);
\draw[fill=black] (n7-13) circle (0.2em);

\draw[fill=white] (n2-3) circle (0.2em);
\draw[fill=white] (n2-9) circle (0.2em);
\draw[fill=white] (n3-4) circle (0.2em);
\draw[fill=white] (n3-5) circle (0.2em);
\draw[fill=white] (n3-6) circle (0.2em);
\draw[fill=white] (n3-7) circle (0.2em);
\draw[fill=white] (n5-6) circle (0.2em);
\draw[fill=white] (n5-11) circle (0.2em);

\end{scope}

\end{tikzpicture}

\end{document}

相关内容