编辑

编辑

我使用以下代码绘制了tikz两个矩阵(两列数组):

\documentclass[crop,tikz,convert={outext=.svg,command=\unexpanded{pdf2svg \infile\space\outfile}},multi=false]{standalone}

\usepackage{tikz}
\usetikzlibrary{positioning, matrix, arrows.meta}

\begin{document}
  \begin{tikzpicture}[x=1cm,y=1.5cm]
    \matrix (N) [% 
      matrix of nodes, 
      nodes={
        rectangle,
        minimum height=6mm,
        minimum width=15mm,
        anchor=center,
        inner sep=0pt, outer sep=0pt
      }
    ] at (3, 0) { $\$_0\$_0\$_0$  \\ $AC\$_1$ \\ $TC\$_2$ \\ $ACA$ \\ $\$_2GA$ \\ $\$_0TA$ \\ $\$_1TA$ \\ $CAC$ \\ $CAC$ \\ $GAC$ \\ $TAC$ \\ $TAC$ \\ $CTC$ \\ $C\$_2G$ \\ $\$_0\$_0T$ \\ $C\$_1T$ \\ $ACT$ \\  };
    \draw (N-1-1.north west) rectangle (N-17-1.south east);
    \node[above=3pt of N-1-1]{$Node$};
    
    \matrix (W) [% 
      matrix of nodes, 
      nodes={
        rectangle,
        minimum height=6mm,
        minimum width=9.5mm,
        anchor=center,
        inner sep=0pt, outer sep=0pt
      }
    ] at (6, 0) { $T$ \\ $T$ \\ $G$ \\ $C$ \\ $C$ \\ $C$ \\ $C^-$ \\ $\$_3$ \\ $\$_1$ \\ $A$ \\ $T$ \\ $A^-$ \\ $\$_2$ \\ $A$ \\ $A$ \\ $A$ \\ $C$ \\  };
    \draw (W-1-1.north west) rectangle (W-17-1.south east);
    \node[above=3pt of W-1-1]{$W$};
  \end{tikzpicture}
\end{document}

但是,我该如何在它们的条目之间建立联系呢?

编辑

如果我使用它\draw (N-1-1) -- (W-5-1);来连接条目,结果如下:

在此处输入图片描述

答案1

\draw ([xshift=-0.1cm] N-1-1.east) to[out=0, in=180] ([xshift=0.1cm] W-5-1.west);

两个节点连接

相关内容